While trying to adapt my component to J4 I get a nasty error message each time I install the component again. I guess this will happen with any component that is able to be installed in J4 (and has a backend menu).
Update a component without any error messages
Using current J4 dev branch
Menu table before the update:
As you see the first row seems to be without an accompagning error messages while the others (childrens) have one.
I tracked it down to \Joomla\CMS\Table\Nested::delete()
which then calls $node = $this->_getNode($pk);
and that one then throws the Exception because the requested row doesn't exist.
I think this happens because during an update the menuitems are deleted and then recreated. When the first menuitem is deleted, it also deletes its children. That part works fine. Now when the second menuitem should be deleted, the row can't be found anymore since it already has been deleted (it's a children of the first menuitem).
What I don't understand is what the difference is between J3.7 and J4 here. In J3.7.0 no error is shown. Obviously the code got namespaced but from looking over it, it looks very similar to the old code.
If it helps to reproduce the issue, I've attached my component.
com_sermonspeaker.zip
Labels |
Added:
?
|
Category | ⇒ | Administration Templates (admin) |
Are menu items always deleted and recreated every update? I'm assuming going to 3.7.0 to 3.7.1-dev (i.e. staging) through Joomla Update you don't get this?
It's always done during component updates, yes (at least I think so). Not during CMS update (at least I hope
Status | New | ⇒ | Discussion |
@brianteeman we did something for the admin menu manager but can't remember what it was exactly. I think the reason for doing it this way was laziness. The other more complicated way would be to compare the old and the now to be created menu and update/delete/create items.
I knew I remembered something
But it still doesn't explain the difference in behavior between J3.7 and J4
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-01 12:53:01 |
Closed_By | ⇒ | Bakual |
I have the same issue when i try to install Artio Bookit Free.
But i'm still using Joomla! 3.8.2
Are menu items always deleted and recreated every update? I'm assuming going to 3.7.0 to 3.7.1-dev (i.e. staging) through Joomla Update you don't get this?