?
avatar Bakual
Bakual
10 May 2017

Steps to reproduce the issue

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).

Expected result

Update a component without any error messages

Actual result

error

System information (as much as possible)

Using current J4 dev branch
Menu table before the update:
table
As you see the first row seems to be without an accompagning error messages while the others (childrens) have one.

Additional comments

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

avatar Bakual Bakual - open - 10 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 10 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 10 May 2017
Category Administration Templates (admin)
avatar wilsonge
wilsonge - comment - 10 May 2017

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?

avatar Bakual
Bakual - comment - 10 May 2017

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 ? ).

avatar brianteeman
brianteeman - comment - 10 May 2017

I seem to recall a pr or comment from @rdeutz on this

avatar franz-wohlkoenig franz-wohlkoenig - change - 10 May 2017
Status New Discussion
avatar rdeutz
rdeutz - comment - 11 May 2017

@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.

avatar brianteeman
brianteeman - comment - 11 May 2017

I knew I remembered something

avatar Bakual
Bakual - comment - 11 May 2017

But it still doesn't explain the difference in behavior between J3.7 and J4 ?

avatar Bakual
Bakual - comment - 1 Jun 2017

Closing as we have a PR #16428

avatar Bakual Bakual - change - 1 Jun 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-06-01 12:53:01
Closed_By Bakual
avatar Bakual Bakual - close - 1 Jun 2017
avatar edthenet
edthenet - comment - 3 Dec 2017

I have the same issue when i try to install Artio Bookit Free.
But i'm still using Joomla! 3.8.2

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Dec 2017

@edthenet Comments on closed Issues didn't get much Notice. Please ask help on the forums or Developers of 3rd-Party-Component.

Add a Comment

Login with GitHub to post a comment