Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Correct way of setting security access to editors


Go to End
Reply


22 Posts   3699 Views

Avatar
Ingo

Forum Moderator, 801 Posts

7 October 2009 at 9:43pm

Is this the same in trunk?

Avatar
AlexBeka

Community Member, 21 Posts

8 October 2009 at 1:17am

i just checked out http://svn.silverstripe.com/open/phpinstaller/trunk and tried the same testcase as described before, and just inserted the following lines into mysite/_config.php

Object::add_extension('SiteTree', 'Translatable');
Translatable::set_default_locale('de_DE');
Translatable::set_allowed_locales(array('de_DE', 'en_US'));

i got the same behaviour, it shows "English" in the dropdown-field but showing the german sitetree;

that´s why i commented out this foreach loop where the locales are removed from $usedLocalesWithTitle;

Avatar
Kalileo

Community Member, 127 Posts

8 October 2009 at 3:22pm

Edited: 08/10/2009 3:24pm

AlexBeka, yes, I have 2.3.3, and I applied the changesets to a Translatable.php as it comes with 2.3.3. (When I used this one [url=http://open.silverstripe.com/browser/modules/sapphire/trunk/core/model/Translatable.php?rev=88123]Translatable.php?rev=88123[/url] I got the mysql errors as described above about "Locale" / `Locale`)

What is different is that I gave my content manager the permissions:

  • Access to Site Content (CMSMain)
  • Access to all CMS interfaces
  • Access to Files and Images (AssetAdmin)
  • Translate into all available languages

Yesterday I had the meeting with the customer and they could edit the content of the German version, no problem, both Languages are shown in the dropdown field.

Can you try with Translate into all available languages? May be that makes the difference.

Otherwise, I remember I had a similar issue as you describe when I misspelled the English locale, using "en_UK" instead of "en_GB".

Avatar
Kalileo

Community Member, 127 Posts

8 October 2009 at 3:49pm

I looked at http://svn.silverstripe.com/open/modules/sapphire/trunk/core/model/Translatable.php (I assume that's the one you have, AlexBeka ), but I cannot use that version, it has satements such as

  • Line 356/357:    sprintf( '"%s"."TranslationGroupID" = %d AND "%s"."Locale" != \'%s\'', ....
  • Line 516: $qry = sprintf('"%s"."Locale" = \'%s\'', $baseTable, $locale);
  • Line 995: $filter .= sprintf(' AND "%s"."Locale" = \'%s\'', $baseDataClass, Convert::raw2sql($locale));

and more like that which seem to result in SQL queries containing WHERE "Whatever"."Locale" = whatever which my MySQL does not like, it would prefer WHERE `Whatever`.`Locale` = whatever.

My server has the latest released MySQL 4.x version, but not yet 5.x, is that the reason? I really hope not, to upgrade that specific server would be a major issue now.

Avatar
AlexBeka

Community Member, 21 Posts

8 October 2009 at 8:52pm

1.) Kalileo, i have the Translatable.php from 2.3.3 branch not from trunk;
you have set the permission-code "Translate into all available languages", i know, that this setting would display then all allowed languages in the dropdown;
but my question was, what happens if you have a translator who should just translate into english and that´s why you give him just the permission to translate into english and not into all languages then this user would see in the dropdown just the english language but he would need also to select the other already existing sitetrees in other languages, like german, to translate these into english;

2.) i testet yesterday the trunk([url]http://svn.silverstripe.com/open/phpinstaller/trunk[/url]) for a short time (adding, translating pages and so on), and had no problems with sql-queries like you described; i am using mysql 5.1.36;

Avatar
Ingo

Forum Moderator, 801 Posts

8 October 2009 at 11:15pm

SilverStripe trunk (what will become 2.4) uses "SET sql_mode = 'ANSI'" which makes db abstraction easier, but breaks backwards compatibility with SQL quoting, which now has to be double quotes instead of backticks, hence you can't simply copypaste the whole Translatable.php without modifications to a 2.3.x installation.

Go to Top