User tests: Successful: Unsuccessful:
Pull Request for Issue #15671 .
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';
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Administration com_admin |
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
@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.
Labels |
Added:
?
|
Category | SQL Administration com_admin | ⇒ | SQL Administration com_admin Postgresql |
Category | SQL Administration com_admin Postgresql | ⇒ | SQL Administration com_admin Postgresql MS SQL |
amended changes description
added mssql,postgresql update
removed unneccessary table prefix
ready to test
I have tested this item
See commment above
I have tested this item
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.
IMO, on an update from 3.7.0, this sql will not execute. You need to add new sql file.
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...
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?
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)
closing the door after the horse has bolted
@PhilETaylor What do you suggest? Description of manual repair procedure in 3.7.0 release FAQ?
Thats pretty much all you can do...
@PhilETaylor Can you prepare such a description?
@alikon My #15695 (comment) is still valid. To make this PR work, there is no change in php and sql files for new installations.
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.
@alikon If you want to change the name of the menutya again, see #15695 (comment)
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
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
Thanks for making this findable.
Jan
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.
@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.
@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.
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?
@richard67 Typo we con't care
.
@richard67 please go for it staging...richard67:fix-menu-type-main,
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-08 04:03:27 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_Date | 2017-06-08 04:03:27 | ⇒ | 2017-06-08 04:03:28 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15695
closed as stated above.
@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?