?
avatar infograf768
infograf768
16 Sep 2017

Steps to reproduce the issue

Set a multilngual site including French Language.
Switch backend to French
Create a new menu item, set its content language to any language available.
Save (NOT Save and close).
Display the Associations tab

You will get:
screen shot 2017-09-16 at 16 36 27

IN French the string is
COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE="- Pas d'association -"

The single quote is escaped in the display although it should not.

The code used is
$option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE');

in
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/models/item.php#L1231-L1245

@izharaazmi
Anyhting we can do?
The way these field are displayed is very different from the other components.

avatar infograf768 infograf768 - open - 16 Sep 2017
avatar joomla-cms-bot joomla-cms-bot - change - 16 Sep 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Sep 2017
avatar izharaazmi
izharaazmi - comment - 16 Sep 2017

@infograf768 Please see if using ' helps. If not I'd look deeper.

COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE="- Pas d'association -"
avatar infograf768
infograf768 - comment - 16 Sep 2017

@izharaazmi
I could use a real typographer quote
But it does not solve the underlying issue.

avatar izharaazmi
izharaazmi - comment - 16 Sep 2017

Alright. I'd see what I can do.

avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Sep 2017
Category com_associations
avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Sep 2017
Status New Discussion
avatar brianteeman
brianteeman - comment - 5 Oct 2017

It is not directly related to this one string and I suspect its either a field or JTEXT issue
As a test I made the following language overrides

  | JGLOBAL_USE_GLOBAL | Use G'lobal
  | JGLOBAL_USE_GLOBAL_VALUE | Use G'lobal (%s)

And as can be seen in the screenshot below depending this may cause issues as well.

screenshotr14-04-10

avatar infograf768
infograf768 - comment - 5 Oct 2017

the associations fields for menu items are not present in a xml. they are created on the fly as explained above. therefore it is not imho a JText issue but a result of the way Options are created.
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/models/item.php#L1231-L1245

avatar infograf768
infograf768 - comment - 4 Mar 2018

I think I found a solution, by not using the specific code

					$option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE');
					$option->addAttribute('value', '');

In that case, it is going to use the default
COM_MENUS_SELECT_A_MENUITEM

And then we need to change the JText from true to false in modal/menu.php
$title_holder = JText::_('COM_MENUS_SELECT_A_MENUITEM'); // instead of true.
in all places. It will take off the counterslash.

The patch could be more important than that though as we do have the possible same issue for modal fields elsewhere in code.

I guess it is better I do a single PR for this specific issue and then a global PR if necessary.

avatar infograf768
infograf768 - comment - 4 Mar 2018

@izharaazmi
What do you think?

avatar izharaazmi
izharaazmi - comment - 4 Mar 2018

@infograf768 In current staging I get this.
image

I installed French language. Logout and logged in with French language selected. Created a new menu item with language = french and hit save (not close). I get this in the association tab.

Am I missing something?

avatar izharaazmi
izharaazmi - comment - 4 Mar 2018

Sorry, I missed that this is for 4.0. Testing again.

avatar infograf768
infograf768 - comment - 4 Mar 2018

In fact it is even more simple.
We can keep the addchild code and then just take off true in modal/menu.php
Will do PR

avatar izharaazmi
izharaazmi - comment - 4 Mar 2018

@infograf768 Same result with 4.0-dev

avatar infograf768
infograf768 - comment - 4 Mar 2018

@izharaazmi
I had changed in French the singlequote to Typographic quote, thus why you do not find the issue.

avatar infograf768
infograf768 - comment - 4 Mar 2018

Making a PR now

avatar infograf768
infograf768 - comment - 4 Mar 2018

and this is for staging :)

avatar infograf768
infograf768 - comment - 4 Mar 2018
avatar infograf768 infograf768 - close - 4 Mar 2018
avatar infograf768 infograf768 - change - 4 Mar 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-03-04 11:17:21
Closed_By infograf768

Add a Comment

Login with GitHub to post a comment