It looks like you're new here. If you want to get involved, click one of these buttons!
'sections' => array(
'type' => 'template',
'display_label' => FALSE,
'label' => 'Sections',
'add_extra' => FALSE,
'repeatable' => TRUE,
'title_field' => 'block',
'fields' =>
array(
'section' => array('type' => 'section', 'value' => 'Block <span class="num">{num}</span>'),
'block' => array('type' => 'block', 'label' => 'Block', 'group' => 'landing'),
),
),
Comments
https://github.com/daylightstudio/FUEL-CMS/commit/3027b34d96ae4b6207bcf69fad544c55831d3499
I noticed another bug related to the multilingual:
Let's say I create a page on the Ukrainian language, after saving I choose German language and add content in German, everything works as it should, but when I come out of the edit page and then choose to edit this page again, the value of the language field is one that was the last when the page was saved (ie German) but the content of the page is Ukrainian ...
To work correctly, I need to change the language in the Ukrainian, otherwise all the corrections will be written in the German version ...
I do not think that this is connected with a browser, I tried to clear history and temporary files - did not help, even tried to go to the CMS from another computer - if the page has been saved in the German language, the selected language is German, and the entire contents - Ukrainian (default language) ...
The change made was just another inidicator in case the dropdown select is remembering the last item you selected instead of what is actually selected.
https://github.com/daylightstudio/FUEL-CMS/commit/fda5365e2fc898968d7c705b81a8c5fadd5a6571
I'm creating a page in the Ukrainian language and save it, then choose German language, add content, save - all goes well ...
I go to the fuel/pages - choose this page and see the following:
The language chosen - German
Content - Ukrainian
Content in the fields with the type template - German!
If I choose Ukrainian language - content in all fields becomes Ukrainian, switch to German - all content becomes German - everything is working properly!
It seems that CMS will remember the last language in which a page was edited and automatically selects it to generate a page for editing in CMS...
I think that browser is nothing to do with it, I went to the CMS from different computers, even those who had previously not been in CMS - behavior all the same...
Maybe it has something to do with language_mode, in my config selected 'segment', in the CMS - 'query_string'...
p.s.
when I added these changes - fda5365e2fc898968d7c705b81a8c5fadd5a6571
it did not change the behavior, but added error:
Message: Undefined offset: 0 Filename: pages / page_create_edit.php Line Number: 58
swears - <?=$languages[$language]?>
If switching language - error disappears
if leave editing page and go back again to edit - the error appears ...
p.p.s
file fuel/modules/fuel/views/pages/page_create_edit.php line 56 has extra colon.
https://github.com/daylightstudio/FUEL-CMS/commit/1a2da448437c1c1d8f6cc48a5a4162da520dc18a
If you inspect the language select element in your browser, is the "selected" property set on that particular option? I'm unfortunately not able to quite replicate your issue at the moment. I check the PageController.js file to see if there may be anything suspicious in there to auto select that field with javascript and didn't see anything.
Also, I'm not quite sure I understand the last comment about line 201... this shouldn't come into play with the pages module because there is no "language" field on the fuel_pages table (more for other modules like navigation and blocks).
If page was saved in German language - "de" will be selected, if Ukrainian - "uk" selected
about line 201:
Yeah, I was surprised too, I had to do so that when I opened simple module in CMS, such as news, I only can see the news on the Ukrainian language, and had the ability to filter them by language, however, when in database table add a field "language", CMS adds filter automatically, when I added a filter like this:
.... 'filters' => array( 'language' => array( 'default' => 'uk', 'label' => 'lang', 'type' => 'select', 'options' => array( 'uk' => 'Українською', 'de' => 'Deutsch' ), ), ),
it added another filter, which does not work properly...
so I decided to make changes to the CMS so that the Ukrainian language has been selected by default, and it worked, but pages in the CMS started behaving strangely:
When I go to the fuel/pages I see a notification - Filters:lang:="uk", and pages that have been stored in the German language in this list does not appear, but if in the Advanced Search choose the language "de", I see pages that were saved in German language for the last time...
If I choose to edit a page, simply change the "Language" on "uk", and hit save - this page appears in the list of pages in Ukrainian.
FUEL_VERSION - 1.3
'filters' => array( 'language' => array( 'default' => 'uk', 'first_option' => 'Select lang...', 'label' => 'Lang:', 'type' => 'select', 'options' => array( 'uk' => 'Українською', 'de' => 'Deutsch' ), ), ),
That will add an additional filter by language, and by default will check records on "uk" language
if type this:
'filters' => array( 'language_equal' => array( 'default' => 'uk', 'first_option' => 'Select lang...', 'label' => 'Lang:', 'type' => 'select', 'options' => array( 'uk' => 'Українською', 'de' => 'Deutsch' ), ), ),
Nothing happens, the filter is not added or overwritten the current, created by CMS automatically ...
if (( ! empty($languages) AND (is_string($first_option) OR (is_array($first_option)) AND count($first_option) > 1)) AND empty($this->filters[$this->language_col.'_equal']))
$values['language'] = $this->fuel->language->default_option();
Now when I save page, regardless of the selected language, the database is always stored the default language, in my case 'uk', and when I need to edit this page I always get the field in terms of 'uk', I understand that the solution is not quite 'right' but it helped get rid of the bug and decided my problem ...
I think the problem cut out in fuel_page_variables, for some strange reason, CMS does not always choose all the required language page variables, at least in my case.
Have a nice day!
I just had the same issue, with latest dev version. It looks like the fix (https://github.com/daylightstudio/FUEL-CMS/commit/3027b34d96ae4b6207bcf69fad544c55831d3499) is not in the latest commit. I put it in my file and works
Sorry, I found it in the feature/1.4_dev.
I'm using the develop branch and the fix is not there.