User tests: Successful: Unsuccessful:
Opening the menu manager right now in 4.0-dev throws a SQL query error. This PR fixes that. Saveing a menu item also results in a PHP error because the data array is missing in the onBeforeContentSave event. This also fixes that. With that, installing sample data is also again possible. So: Happy merging!
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_menus |
@SniperSister @zero-24 seems to me a false positive
The second issue should be fixed in the plugin by declaring default $data
value:
This is what I proposed here
https://github.com/joomla/joomla-cms/issues/23276#issuecomment-447659297
@infograf768 Except that $data should have default value set to an empty array instead of empty string as you proposed.
Personal, I would like to see the validated $data available in the event handler so that in case plugin needs input data, it can get it directly from $data array instead of having to get it from application input. We pass that data for saving article already, and should do the same for other items in the core (of course in a different PR). So to me, this PR is good as it is.
For some reasons, I could not see error with menus manager, and could not mark the test as success (maybe Joomla 4 installation is few days outdated)
The problem is, that the event is used with the $data and that that has been released into the wild. At the same time, $data is missing from the documentation, so... Either we drop the $data completely or we make it mandatory. I'm voting for mandatory.
I would vote for mandatory, too, just worry that it will make third party extensions broken.
Yes and no. It wouldn't break third party extensions, since they simply get one more parameter, which they ignore. But that wouldn't really matter, since we can break stuff for 4.0.
It would break third party extensions if they implement custom save method in their model (same with how our menu item model which you fix issue on this PR). But Yes, I vote for it mandatory, too.
@Hackwar can you remove the sql query modification. That's going to be fixed at root cause in #23344 and avoids the comment mentioned by @csthomas here.
RE: Data parameter was added in #13638 . I've now documented it as required https://docs.joomla.org/Plugin/Events/Content#onContentBeforeSave - it shouldn't affect that many people as it's been default in the base model to send this since 3.7 and will be fully supported in j3 if people do it
Tested successfully when only administrator/components/com_menus/Model/ItemModel.php chenge is applied.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-12-27 17:38:00 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Not sure why this issue is closed. The issue still stands: When clicking on Menus > Main Menu in Alpha 6 I get this message:
"An error has occurred.
500 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.published
,a
.component_id
,a
.checked_out
,a
.checked_out_time
,a
.`br' at line 1"
@Scrabble96 Please test on latest 4.0 nightly build.
@Scrabble96 just as an FYI the nightly is the current state of development - the roughly monthly alpha's are fixed releases
see discussion here:
#23276