? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
30 Apr 2017

Pull Request for Issue #15671 .

Summary of Changes

starting from 3.6.5 2.5 the menu type "menu" and "main" are reserved in 3.7.0 only "main"
so if you are upgranding from a prevoius version and you have a menutype named "main" (was alloweed)

this update in administrator/components/com_admin/sql/updates/mysql/3.7.0-2017-01-17.sql

UPDATE `#__menu` SET `menutype` = 'main', `client_id` = 1  WHERE `menutype` = 'main' OR `menutype` = 'menu';

is not correct for no pseudo FK ect, changed to :

UPDATE `#__menu`
SET `#__menu`.`menutype` = 'menutype_main_is_reserved'
    ,`client_id` = 1
WHERE `#__menu`.`menutype` = 'main' ;

UPDATE `#__menu_types` 
SET `#__menu_types`.`menutype` = 'menutype_main_is_reserved'
    ,`client_id` = 1
WHERE  `#__menu_types`.`menutype` = 'main';

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar alikon alikon - open - 30 Apr 2017
avatar alikon alikon - change - 30 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Apr 2017
Category SQL Administration com_admin
avatar richard67
richard67 - comment - 30 Apr 2017

@alikon I just see it needs the same change also for postgres and mssql. Will you do that, or shall I do that for you and make a PR against your branch which includes also corrections I mentioned in my comments?

avatar brianteeman
brianteeman - comment - 30 Apr 2017

starting from 3.6.5 the menu type "menu" and "main" are reserved in 3.7.0 only "main"

This is not true - they have been reserved since Joomla 2.5

avatar wojsmol
wojsmol - comment - 30 Apr 2017

@alikon I will test when PR will be ready.
@brianteeman We should maintain a B/C of up to 1.6 for changes in user data during the update.

avatar alikon alikon - change - 1 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 1 May 2017
Category SQL Administration com_admin SQL Administration com_admin Postgresql
avatar joomla-cms-bot joomla-cms-bot - change - 1 May 2017
Category SQL Administration com_admin Postgresql SQL Administration com_admin Postgresql MS SQL
avatar alikon alikon - change - 1 May 2017
The description was changed
avatar alikon alikon - edited - 1 May 2017
avatar alikon
alikon - comment - 1 May 2017

amended changes description
added mssql,postgresql update
removed unneccessary table prefix
ready to test

avatar wojsmol
wojsmol - comment - 1 May 2017

@alikon PR is incomple, alter runig queroes in phpmyafmin ang refreshing backeng Componens menu desapered.

avatar wojsmol
wojsmol - comment - 1 May 2017

I have tested this item ? unsuccessfully on a85e72d

See commment above


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

avatar wojsmol wojsmol - test_item - 1 May 2017 - Tested unsuccessfully
avatar izharaazmi
izharaazmi - comment - 2 May 2017

I have tested this item ? unsuccessfully on a85e72d

You need to tell other codes about the new name "menutype_main_is_reserved", else they still assume "main"

IMHO, this is name does not seem right. May be we can use "system_adminmenu" or "joomla_adminmenu" etc.


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

avatar izharaazmi izharaazmi - test_item - 2 May 2017 - Tested unsuccessfully
avatar izharaazmi
izharaazmi - comment - 2 May 2017

IMO, on an update from 3.7.0, this sql will not execute. You need to add new sql file.

avatar izharaazmi
izharaazmi - comment - 2 May 2017

@alikon This brings me a question that using main was allowed before 2.5 (as you said) and its not allowed in 2.5.x ~ 3.7; how come it only caused problem when updating to 3.7 only? Are we dealing with direct update of 1.6 or 1.7 to 3.7 here?

avatar wojsmol
wojsmol - comment - 2 May 2017
avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

This is closing the door after the horse has bolted.

By the time you have upgraded to Joomla 3.7.0 or (with this in 3.7.1) your menus are already destroyed.

The times I have investigated this, main came from crappy loaded template providers "quick start" packages...

avatar richard67
richard67 - comment - 2 May 2017

The problem is that when some menus already are messed by 3.7.0-2017-01-17.sql with the Joomla 3.7.0 update, there is no SQL statement to change them back because they can't be distinguished from other menus for which the oroginal SQL statement from 3.7.0-2017-01-17.sql was applied by intention. Or am I wrong?

avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

The problem is that when some menus already are messed by 3.7.0-2017-01-17.sql with the Joomla 3.7.0 update, there is no SQL statement to change them back because they can't be distinguished from other menus for which the oroginal SQL statement from 3.7.0-2017-01-17.sql was applied by intention

which is what I mean by closing the door after the horse has bolted. (possibly lost in translation)

avatar alikon
alikon - comment - 2 May 2017

closing the door after the horse has bolted

? instead of ? in italian
?

avatar wojsmol
wojsmol - comment - 2 May 2017

@PhilETaylor What do you suggest? Description of manual repair procedure in 3.7.0 release FAQ?

avatar PhilETaylor
PhilETaylor - comment - 2 May 2017

Thats pretty much all you can do...

avatar wojsmol
wojsmol - comment - 2 May 2017

@PhilETaylor Can you prepare such a description?

avatar wojsmol
wojsmol - comment - 2 May 2017

@alikon My #15695 (comment) is still valid. To make this PR work, there is no change in php and sql files for new installations.

avatar alikon
alikon - comment - 2 May 2017

@wojsmol the tables #__menu and #__menu_types are related by the menutype field
so if you change a #__menu table item you should change a #__menu_types too accordingly if you want to mantain the relation

avatar izharaazmi
izharaazmi - comment - 2 May 2017

IMO, changing this once again will do more harm than good. Not sure though. I'd comment back once I get a chance to look into J1.6/J1.7 codes and find something relevant.

avatar wojsmol
wojsmol - comment - 2 May 2017

@alikon If you want to change the name of the menutya again, see #15695 (comment)

avatar izharaazmi
izharaazmi - comment - 2 May 2017

IMO, he's not trying to change the name of the protected menu type. Rather of any site menu using this protected name. Am I right @alikon?

avatar alikon
alikon - comment - 3 May 2017

Yes @izharaazmi, i just wanted to replace old site with reserved menutype term "main" with unreserved term like 'menutype_main_is_reserved' or whatever to avoid conflicts
i hope someone have much more free time than me to deep dig in 1.6/1.7 to 3.7.x upgrade process ...
even if i think this issue should arise on very edge case

avatar Supergran
Supergran - comment - 11 May 2017

Just to add I've had this issue today. The original site was constructed about 3 or 4 years ago, and for some reason I had a menu called menu. The site has been regularly updated and worked fine and today I updated from 3.65 to 3.7. The front end menu items appeared in the components menu as described. Took me a while to find this thread and I've now fixed it via the database and doing a proper job on the menu name ? I feel like I should have known this but ...
Thanks for making this findable.

Jan


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

avatar richard67
richard67 - comment - 28 May 2017

I suggest to do it like this in the 3.7.0-2017-01-17.sql files, example here for mysql:

-- Sync menutype for admin menu and set client_id correct
-- Update with Joomla 3.7.3: Limit this to menus having no record in table
-- #__menu_types for their menutype so it really catches admin menus only.
UPDATE #__menu SET menutype = 'main', client_id = 1 WHERE menutype IN ('main', 'menu')
AND id IN (SELECT id FROM #__menu me
WHERE NOT EXISTS (SELECT 1 FROM #__menu_types mt WHERE me.menutype = mt.menutype));

-- Added with Joomla 3.7.3: Replace menutypes = 'main' in frontent because it is reserved for backend
-- Use a value for menutype which makes it as unlikely as possible to conflict with an already
-- existing menu type.
UPDATE #__menu SET menutype = 'main_is_reserved' WHERE client_id = 0 AND menutype = 'main';
UPDATE #__menu_types SET menutype = 'main_is_reserved' WHERE client_id = 0 AND menutype = 'main';

For postgresql and sqlazure (aka mssql) it is the same except of the different quoting of table names and column names, as far as I could check with the online syntax references.

@alikon I wanted to make a PR against your branch with changes for all 3 sql files but I did not succeed.

avatar richard67
richard67 - comment - 28 May 2017

@alikon I just corrected my SQL in my previous comment. Now it should be ok. You could fetch these changes from my branch https://github.com/richard67/joomla-cms/tree/fix-menutype-main, or I make a new PR myself, however you prefer. Just let me know.

avatar richard67
richard67 - comment - 28 May 2017

@alikon Hmm, I see my statements are still not ok. The modules of type menu have the menu type in their parameter, so if some user created any frontend module it would cause a mess. Either we limit the 2nd statement to client_id = 1 in the where clause, or we do a replace on the parameters of the modules, but that could be risky. And is the user also able to create modules of type menu in backend? If so, we should replace in the parameters anyway.

avatar richard67
richard67 - comment - 28 May 2017

@alikon Hmm, I am still not happy with my proposals above, I have to think it over.

avatar richard67
richard67 - comment - 5 Jun 2017

@alikon Anyway, at least you have to change the strings 'menutype_main_is_reserved' to something shorter, e.g. 'main_is_reserved'. because the menutype columns of tables #__menu and #__menu_types are limited to 24 charactersm but 'menutype_main_is_reserved' has 25.

avatar richard67
richard67 - comment - 5 Jun 2017

Meanwhile I have created another proposal on how it could be done, see here: https://github.com/richard67/joomla-cms/tree/fix-menu-type-main.

Wgar do you think about it?


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

avatar Quy
Quy - comment - 6 Jun 2017

@richard67 Typo we con't care.

avatar richard67
richard67 - comment - 6 Jun 2017

@Quy Thanks, corrected. And beside the typo, what do you think?

avatar alikon
alikon - comment - 7 Jun 2017

@richard67 please go for it staging...richard67:fix-menu-type-main,

  • mine was a speedirty fix,
  • your is well documented too
avatar richard67
richard67 - comment - 7 Jun 2017

I created now PR #16577 with my solution as proposed above. It replaces this PR here. Please test as soon as I have completed the testing instructions.

avatar richard67
richard67 - comment - 7 Jun 2017

PR #16577 is ready. Please test.
This one here can be closed according to @alikon.

avatar joomla-cms-bot joomla-cms-bot - close - 8 Jun 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Jun 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-06-08 04:03:27
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2017
Closed_Date 2017-06-08 04:03:27 2017-06-08 04:03:28
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot
joomla-cms-bot - comment - 8 Jun 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Jun 2017

closed as stated above.


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

Add a Comment

Login with GitHub to post a comment