CMSB 3.81 menu groups BUG?
4 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 10:53am (RSS)
I was recreating my menugroups as some had very old extraneous fields. I notice that the new menugroup had an extra entry for menuOrder. I thought that menuOrder was no longer required. These were recreated in CMSB 3.81
<?php return [
'menuName' => ' App Settings ',
'_tableName' => 'app_settings_menugroup',
'_primaryKey' => 'num',
'menuType' => 'menugroup',
'listPageFields' => '',
'listPageOrder' => '',
'listPageSearchFields' => '',
'_filenameFields' => '',
'_perPageDefault' => NULL,
'alwaysExpanded' => 0,
'menuOrder' => 1211054592,
];
yaadev.com
By Dave - Monday at 1:51pm
Hi Jeff,
Yes, you're right. menuOrder is no longer used. Menu order is now stored in a separate cache file.
The upgrade process removes menuOrder from existing schemas, but we try to be non-destructive with unknown data, so if these schemas were imported or recreated from older files, extra keys won't be automatically stripped.
You can safely remove it. It's just being ignored.
Let me know if you have any other questions, thanks!
interactivetools.com
By kitsguru - Monday at 3:48pm
They were created in 3.81. I deleted the old one usine the database editor. Confirmed the database record was removed and the file deleted. i then recreated the menugroup. Checked the dtatabase, new record created. Checked the file and no menuOrder. dragged it into position and the menuOrder was added to the schema.pho file.
yaadev.com
By Dave - Yesterday at 10:53am
Hi Jeff,
Thanks, I was able to reproduce that. There was some legacy code in the schema preset file that was adding that exact value:
'menuOrder' => 1211054592,
This field was part of an old menu ordering system that's no longer used - menu order is now managed separately. We'll remove it from the preset files for the next release and update saveSchema() to automatically strip it on save going forward.
Note that some existing plugins still set menuOrder when creating multiple tables (to keep them grouped together on initial install), but the new code will clean that up automatically once the tables exist in the menu and the schema is saved again.
Thanks!
interactivetools.com