? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
18 Aug 2019

Summary of Changes

What this does:
Adding badge to menus containing a home.
Not flags as some languages may chose to not use flags.
For this, modified sql select in joomla, menus and modern presets
Allow custom admin menu items to display an image or a badge (modified the xmls).
Take off links for separator menu items and make sure they are aligned correctly also for custom admin menu.

What it does not do:
Does not solve creating a full custom admin menu with a preset.
Does not solve some issues with custom admin menu items of type heading and container, etc.
Does not solve various issues with the "modern" preset (dropdowns, etc.)

Left in the existing presets the code ELSE 'image:mod_languages/icon-16-language.png' END which I think can be deleted.
Left the image class alone for now.
Not sure what to do with Title Attribute and Link Class (EDIT: modified, see below). Left them for now.
Waiting for advice on these.

Testing Instructions

Create a multilingual site with the multilingual sample data.
Create a custom admin menu and add a few menu items.

When creating these, you will get this display, here for a Languages menu item where both icon class and image have been entered:

Screen Shot 2019-08-18 at 18 27 59

The Description of the new icon link field needs certainly love and care. Maybe use class and not code

(EDIT: modified, see below)

After patch

For menu items containing homes:

Screen Shot 2019-08-18 at 18 29 55

For a custom admin menu item (Global Config has an image as icon, Container has icon but does not work

Screen Shot 2019-08-18 at 18 40 11

Should also be fine in RTL

avatar infograf768 infograf768 - open - 18 Aug 2019
avatar infograf768 infograf768 - change - 18 Aug 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Aug 2019
Category Administration com_menus Language & Strings Modules Templates (admin)
avatar brianteeman
brianteeman - comment - 18 Aug 2019

Surely you dont need to add the new Link Icon field just fix the bug with the existing link class not working. To add an icon to a front end menu item you use the link class. Surely it should be the same for an admin menu?

avatar brianteeman
brianteeman - comment - 18 Aug 2019

This PR is mixing several different things - it will be much easier to test and merge if each issue has its own pull request

avatar infograf768
infograf768 - comment - 19 Aug 2019

Surely you dont need to add the new Link Icon field just fix the bug with the existing link class not working. To add an icon to a front end menu item you use the link class. Surely it should be the same for an admin menu?

As I said above:

Not sure what to do with Title Attribute and Link Class. Left them for now.

OK. I will get rid of the Link Class (and therefore of the supplementary spacer) as the name of the field menu-anchor-css any way does not fit and it should be clear it is for an icon which superseeds the image field therefore needs a description. Will call the field "Link Icon Class"
Modification coming.

This PR is mixing several different things - it will be much easier to test and merge if each issue has its own pull request

I do not think so. It concerns the same default_submenu.php file and it would be a pain to do it piece by piece. It's easy to test for whoever really want to test. There are only 3 aspects to test...

avatar infograf768 infograf768 - change - 19 Aug 2019
Labels Added: ? ?
avatar infograf768
infograf768 - comment - 19 Aug 2019

We now have

Screen Shot 2019-08-19 at 09 06 49

avatar infograf768 infograf768 - change - 19 Aug 2019
The description was changed
avatar infograf768 infograf768 - edited - 19 Aug 2019
652ea16 19 Aug 2019 avatar infograf768 lang
avatar wilsonge wilsonge - change - 19 Aug 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-08-19 18:44:09
Closed_By wilsonge
avatar wilsonge wilsonge - close - 19 Aug 2019
avatar wilsonge wilsonge - merge - 19 Aug 2019
avatar wilsonge
wilsonge - comment - 19 Aug 2019

Thanks!

avatar Hackwar
Hackwar - comment - 19 Aug 2019

This PR breaks Postgres.

Error: The 'atum' service key is already registered.: 42803, 7, FEHLER: Spalte »l.lang_code« muss in der GROUP-BY-Klausel erscheinen oder in einer Aggregatfunktion verwendet werden LINE 1: ... '*' THEN 'class:icon-home' ELSE CONCAT('image:', l.lang_cod... ^

avatar wilsonge
wilsonge - comment - 19 Aug 2019

@alikon @twister65 @richard67 can you look into postgresql please. Sorry I failed merging with failing tests

avatar richard67
richard67 - comment - 19 Aug 2019

Am looking already, but all i can see is that if syntax is wrong now, it should also have been wrong before this PR.

avatar richard67
richard67 - comment - 19 Aug 2019

@Hackwar @wilsonge I think this concept of presets using xml files with hard-coded sql statements which have to work on any of the supported databasy types is sick. If that would work with all our tables, to use one and the same sql statement syntax with case when and left join and whatever else, we would not need names quoting, not need different sql scripts for different db types ... we would not even need different drivers if we could do all with ISO standard SQL. But everybody knows this is not the case ... except of those people who have designed this crazy presets feature working in this way. It is 00.22 now here, I will not find the error today.

Can someone open an issue for that so it will not be forgotten?

avatar infograf768
infograf768 - comment - 20 Aug 2019

Folks, indeed I cannot test on Postgres.
As stated in the description of the changes, I had to use that trick to cope with Content Languages which have no flags/image defined.

@Hackwar @richard67
Please can you test postgres on 3.x to see if it is the way I modified the sq_select which is at stake or if the issue is also present in 3.x.

The code modified is

-		sql_select="a.title, a.menutype, CASE COALESCE(SUM(m.home), 0) WHEN 0 THEN '' WHEN 1 THEN CASE m.language WHEN '*' THEN 'class:icon-home' ELSE CONCAT('image:mod_languages/', l.image, '.gif') END ELSE 'image:mod_languages/icon-16-language.png' END AS icon"
+		sql_select="a.title, a.menutype, CASE COALESCE(SUM(m.home), 0) WHEN 0 THEN '' WHEN 1 THEN CASE m.language WHEN '*' THEN 'class:icon-home' ELSE CONCAT('image:', l.lang_code) END ELSE 'image:mod_languages/icon-16-language.png' END AS icon"
avatar infograf768
infograf768 - comment - 20 Aug 2019

Note:
Just saw now that the Home language badges are not present when displaying the Menus dashboard... Have also to look into this...

avatar alikon
alikon - comment - 20 Aug 2019

is not this PR that broke postgresql .... postgresql is broken all over in 4.0 sadly

avatar infograf768
infograf768 - comment - 20 Aug 2019

@Hackwar
I am not a German speaker, but it looks like the error you posted "may" be solved by a wrong sql_group.
See 60324ed
can you check?

avatar Hackwar
Hackwar - comment - 20 Aug 2019

@alikon Can you please stop with this constant doom and gloom?

avatar infograf768
infograf768 - comment - 20 Aug 2019

@Hackwar
Please test #25938

avatar Hackwar
Hackwar - comment - 20 Aug 2019

I'm waiting for the result of drone.

avatar infograf768
infograf768 - comment - 20 Aug 2019

Issue solved by #25938

Add a Comment

Login with GitHub to post a comment