? Pending

User tests: Successful: Unsuccessful:

avatar kesh52
kesh52
8 Feb 2016

By editing of menu items there is a problem that you can't distinguish between menu items with the same title.
Example:
You have 2 menu items with the title "News", but they have different parents or belongs to different menus. By searching for "News" you will get 2 menu items without knowing, which menu item belongs to which parent menu item.

In order to select the right menu item, you need to write own aliases, which defines belogning to a parent menu item (See screenshots)
image
Joomla standard (current state):
image

My solution:
I added the aliases in the Menu Item and Parent Item dropdown field.
image
image

How to test:
1) Open some existing menu item or create a new menu item
2) Click_ Menu Item Type_ and select Menu Item Alias
3) Open the Menu Item OR Parent Item dropdown field and you will see aliases behind the titles

avatar kesh52 kesh52 - open - 8 Feb 2016
avatar kesh52 kesh52 - change - 8 Feb 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Feb 2016
Labels Added: ?
avatar brianteeman
brianteeman - comment - 9 Feb 2016

It would be great if you could update your code as it failed the CI tests

FILE: ...libraries/cms/form/field/menuitem.php

FOUND 5 ERROR(S) AFFECTING 5 LINE(S)

198 | ERROR | Tabs must be used to indent lines; spaces are not allowed
199 | ERROR | Tabs must be used to indent lines; spaces are not allowed
200 | ERROR | Tabs must be used to indent lines; spaces are not allowed
201 | ERROR | Tabs must be used to indent lines; spaces are not allowed

202 | ERROR | Tabs must be used to indent lines; spaces are not allowed

9bcb234 9 Feb 2016 avatar wojsmol CS
599eadf 9 Feb 2016 avatar wojsmol cs
36f3338 9 Feb 2016 avatar wojsmol cs
avatar wojsmol
wojsmol - comment - 9 Feb 2016

@kesh52 See CS fix kesh52#1

avatar kesh52
kesh52 - comment - 9 Feb 2016

@wojsmol thank you :)

avatar brianteeman brianteeman - test_item - 11 Feb 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 11 Feb 2016

I have tested this item :white_check_mark: successfully on d835b5f

I can confirm the issue as described and this PR resolves the issue
But it looks very ugly with the line wraps etc and is actually harder to read now maybe the alias should be on a second line and even in italics


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar bertmert
bertmert - comment - 11 Feb 2016

maybe the alias should be on a second line and even in italics

and/or a Bootstrap class in XML file for the field: input-large or input-xlarge ? They are nearly all too small.

avatar JoomliC
JoomliC - comment - 18 Feb 2016

But it looks very ugly with the line wraps etc and is actually harder to read now maybe the alias should be on a second line and even in italics

I agree but unfortunately, not possible (i think) to add HTML inside option tags as it is...
Does having menu item ID to replace too long alias could be easier ?

  • News [id:13]
  • News [id:17] ...
avatar brianteeman
brianteeman - comment - 18 Feb 2016

I dont think adding the ID would serve the intended purpose of this PR

avatar renekorss renekorss - test_item - 18 Feb 2016 - Tested successfully
avatar renekorss
renekorss - comment - 18 Feb 2016

I have tested this item :white_check_mark: successfully on d835b5f

Not pretty, but it helps a lot.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar infograf768
infograf768 - comment - 18 Feb 2016

This may become really confusing when using UTF8 aliases, in LTR as well as RTL (the parenthesis)

screen shot 2016-02-18 at 09 25 24
screen shot 2016-02-18 at 09 24 34

avatar bertmert
bertmert - comment - 18 Feb 2016

A quick(!) workaround(!) concerning linebreaks:
Add a newline "\n"

$titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias);

Replace newline by BR only if "chosened" select box (selector .chzn-done):

  $options = array_merge(parent::getOptions(), $options);
$js = '
(function($){
 $(window).load(function(){
  $("#' . $this->id . '.chzn-done option").each(
   function()
   {
    var html = $(this).html().replace(/\n/,"<br>");
    $(this).html(html);
   }
  );

  $("#' . $this->id . '").trigger("liszt:updated");

 });
})(jQuery);
';
JFactory::getDocument()->addScriptDeclaration($js);
  return $options;

I wanted to upload an image but since weeks now i get a message:

"Something went really wrong, and we can’t process that file."

avatar JoomliC
JoomliC - comment - 18 Feb 2016

@bertmert Great!!! :+1:

So, attached 2 screenshots (LTR and RTL) and minor changes of your code (html rendering).
I think @kesh52 that you could use it ? (code for menuparent, but should work the same for menuitem field)

capture d ecran 2016-02-18 a 19 04 06 capture d ecran 2016-02-18 a 19 06 57

Code menuparent.php (lines 78 -> 107):

        // Pad the option text with spaces using depth level as a multiplier.
        for ($i = 0, $n = count($options); $i < $n; $i++)
        {
            $titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias);
            $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text . $titleAlias;
        }

        // Merge any additional options in the XML definition.
        $options = array_merge(parent::getOptions(), $options);

        $js = '
        (function($){
            $(window).load(function(){
                $("#' . $this->id . '.chzn-done option").each(
                    function(){
                        var arr = $(this).html().split(/\n/);
                        var html = arr[1] ? arr[0]+"<br />&#160;&#160;<small>("+arr[1]+")</small>" : arr[0];
                        $(this).html(html);
                    }
                );

                $("#' . $this->id . '").trigger("liszt:updated");

            });
        })(jQuery);
        ';

        JFactory::getDocument()->addScriptDeclaration($js);

        return $options;
avatar brianteeman
brianteeman - comment - 18 Feb 2016

I'm not convinced that this solves the problem. You can have multiple menus
with the identical title AND alias as long as they have different parent
items. The screenshot from @joomlic (which does look better than the
original) wouldn't help determine which is the menu item you want to edit
On 18 Feb 2016 6:15 pm, "Cyril Rezé" notifications@github.com wrote:

@bertmert https://github.com/bertmert Great!!!

So, attached 2 screenshots (LTR and RTL) and minor changes of your code
(html rendering).
I think @kesh52 https://github.com/kesh52 that you could use it ? (code
for menuparent, but shuld work the same for menuitem field)

[image: capture d ecran 2016-02-18 a 19 04 06]
https://cloud.githubusercontent.com/assets/2385058/13153257/6eefaf7a-d673-11e5-8553-f54a8379eb55.png [image:
capture d ecran 2016-02-18 a 19 06 57]
https://cloud.githubusercontent.com/assets/2385058/13153281/87510c08-d673-11e5-9730-d7c403f10665.png

Code menuparent.php (lines 78 -> 107):

    // Pad the option text with spaces using depth level as a multiplier.
    for ($i = 0, $n = count($options); $i < $n; $i++)
    {
        $titleAlias = "\n" . JText::_('JFIELD_ALIAS_LABEL') . ': ' . $db->escape($options[$i]->alias);
        $options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text . $titleAlias;
    }

    // Merge any additional options in the XML definition.
    $options = array_merge(parent::getOptions(), $options);

    $js = '
    (function($){
        $(window).load(function(){
            $("#' . $this->id . '.chzn-done option").each(
                function(){
                    var arr = $(this).html().split(/\n/);
                    var html = arr[1] ? arr[0]+"<br />&#160;&#160;<small>("+arr[1]+")</small>" : arr[0];
                    $(this).html(html);
                }
            );

            $("#' . $this->id . '").trigger("liszt:updated");

        });
    })(jQuery);
    ';

    JFactory::getDocument()->addScriptDeclaration($js);

    return $options;


Reply to this email directly or view it on GitHub
#9086 (comment).

avatar JoomliC
JoomliC - comment - 18 Feb 2016

I'm not convinced that this solves the problem. You can have multiple menus with the identical title AND alias as long as they have different parent items. The screenshot from @joomlic (which does look better than the original) wouldn't help determine which is the menu item you want to edit
This why i thought first of menu item id...
Do you mean having parent menu item at the place of the alias ?
Something like this ?
capture d ecran 2016-02-18 a 20 09 07

avatar brianteeman
brianteeman - comment - 18 Feb 2016

That's the only solution to the original request but still won't really
solve it if you have a complex nested menu. I'm just not convinced that for
the number of users who have the problem it is worth spoiling the UI for
everyone else
On 18 Feb 2016 7:09 pm, "Cyril Rezé" notifications@github.com wrote:

I'm not convinced that this solves the problem. You can have multiple
menus with the identical title AND alias as long as they have different
parent items. The screenshot from @joomlic https://github.com/joomlic
(which does look better than the original) wouldn't help determine which is
the menu item you want to edit
This why i thought first of menu item id...
Do you mean having parent menu item at the place of the alias ?
Something like this ?
[image: capture d ecran 2016-02-18 a 20 09 07]
https://cloud.githubusercontent.com/assets/2385058/13154905/89d60c28-d67b-11e5-820a-28482437721e.png


Reply to this email directly or view it on GitHub
#9086 (comment).

avatar Bakual
Bakual - comment - 18 Feb 2016

I tend to agree with Brian. It's an issue very specific to a setup.
There is actually a simple solution to the issue which doesn't need any code.
Just don't use the filtering and select the correct menu by scrolling through the list.

avatar JoomliC
JoomliC - comment - 18 Feb 2016

That's the only solution to the original request but still won't really solve it if you have a complex nested menu. I'm just not convinced that for the number of users who have the problem it is worth spoiling the UI for everyone else

I don't have yet other ideas (but this could give ones to others!) ;-)
In my opinion, even if 2 successful checks, this PR is not ready for RTC (display and RTL issues).
The way to solve original PR issue is using @bermert code (first screenshots with alias, as aim of this PR by @kesh52 ).
We can confirm the issue reported by @kesh52 , what is more difficult to determine is how to add the needed info to solve this (maybe only needed if using chosen search filtering the list of menu items ?)...

avatar JoomliC
JoomliC - comment - 18 Feb 2016

I tend to agree with Brian. It's an issue very specific to a setup.
There is actually a simple solution to the issue which doesn't need any code.
Just don't use the filtering and select the correct menu by scrolling through the list.

See your post after writing my last comment...
I agree that info is not needed in the select list, but maybe the heart of the problem is to add the info when using filtering only (the case this issue happens).
;)

avatar JoomliC JoomliC - test_item - 18 Feb 2016 - Tested unsuccessfully
avatar JoomliC
JoomliC - comment - 18 Feb 2016

I have tested this item :red_circle: unsuccessfully on d835b5f


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar brianteeman
brianteeman - comment - 27 Feb 2016

Setting to Needs Review so the CMS maintainers can make a decision


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar brianteeman brianteeman - change - 27 Feb 2016
Status Pending Needs Review
avatar brianteeman brianteeman - change - 30 Mar 2016
Category Administration
avatar joris85
joris85 - comment - 15 Apr 2016

The patch is not good yet if you ask me.
A menu-item alias can be the same is it in an other parent.
So when i not change the alias i still see exactly the same infoscreen shot 2016-04-15 at 09 12 59

https://www.dropbox.com/s/obytw2akqgeqrv8/Screenshot%202016-04-15%2016.09.01.png?dl=0


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar Simonkloostra Simonkloostra - test_item - 15 Apr 2016 - Tested successfully
avatar Simonkloostra
Simonkloostra - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on d835b5f

Tested succesfully, menu-item-aliasses are nicely shown.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar roland-d roland-d - change - 7 May 2016
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2016-05-07 13:46:27
Closed_By roland-d
avatar roland-d
roland-d - comment - 7 May 2016

Thank you all for your contribution. I am going to close this PR as it doesn't fully solve the issue nor is it a common issue. To really fix this problem we need a different GUI setup to properly see and select the right item.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9086.

avatar roland-d roland-d - close - 7 May 2016

Add a Comment

Login with GitHub to post a comment