? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
1 Jun 2017

Pull Request for Issue #15929.

During installation of a component, all existing menuitems of that component are deleted and recreated afterwards.
This is done by fetching all menuitems of said component using a database query and then iterating over each of them and deleting it using JTableNested::delete().
That method takes a second option argument which defaults to true and makes sure that children are deleted as well.
Now that is nice but since we are iterating over all menuitems, it means that in the first iteration the parent is deleted and all successive deletes of the children fail and generate an error that _getNode can't find the item.

The difference between J3.7 and J4 is that in J3.7 the errors are pushed into $this->_errors but neither the return value (false) nor that error array is ever checked afterwards.
In J4 a warning is raised and thus those errors suddenly become visible.

Summary of Changes

This changes the call so it doesn't delete the children.

Testing Instructions

In J3 there isn't much you can test beside that menuitems are deleted/recreated as expected after updating an extension with a submenu (eg SermonSpeaker https://www.sermonspeaker.net/download/sermonspeaker-component/sermonspeaker-component-5-6-2/com_sermonspeaker-zip.zip).

In J4 this will prevent the error messages mentioned in the above issue.

Expected result

Component updates as expected

Actual result

Component updates as expected

Documentation Changes Required

None

avatar Bakual Bakual - open - 1 Jun 2017
avatar Bakual Bakual - change - 1 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jun 2017
Category Libraries
avatar Bakual Bakual - change - 1 Jun 2017
The description was changed
avatar Bakual Bakual - edited - 1 Jun 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Jun 2017

Install com_sermonspeaker.zip in Joomla4 got Internal Server Error.

System information

4 (latest nightly build)
macOS Sierra, 10.12.5
Firefox 53 (64-bit)

MAMP 4.1.1

  • PHP 7.0.15
  • MySQLi 5.6.35
avatar Bakual
Bakual - comment - 2 Jun 2017

Yep, that zip only works in J3 due to the various B/C breaks J4 will bring.
For J4, you will have to install my development version:
com_sermonspeaker.zip

avatar Bakual
Bakual - comment - 2 Jun 2017

Be aware that this PR is for J3 and needs to be merged up into J4 afterwards. You can't apply it to J4 in the current form.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Jun 2017

Installed and uninstalled Sermonspeaker in Joomla 3: All submenus in Table _menu are deleted. I'm not sure if this is an successfully test.

avatar Bakual
Bakual - comment - 3 Jun 2017

Expected behavior:
When installing a component, the menus are created.
When updating a component, the menus are deleted and recreated without any errors.
When uninstalling a component, the menus are deleted.

As said, there isn't much to test other than the behavior is the same as before, meaning the menus are there after installing/updating and gone after uninstalling.
The errors which happend upong deleting the menus don't show in J3.

avatar Quy Quy - test_item - 22 Jun 2017 - Tested successfully
avatar Quy
Quy - comment - 22 Jun 2017

I have tested this item successfully on 29bc7ca


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16428.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Oct 2017

@Bakual so if its expected Behavior i can mark Test as successfully?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16428.

avatar Bakual
Bakual - comment - 26 Oct 2017

Yep, I think so.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 26 Oct 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Oct 2017

I have tested this item successfully on 29bc7ca


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16428.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Oct 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Oct 2017

RTC after two successful tests.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Oct 2017

@Bakual can you please resolve conflicting Files?

avatar alikon
alikon - comment - 26 Oct 2017

is this the same of #18404

avatar Bakual
Bakual - comment - 26 Oct 2017

Looking at its code, I'd say yes. Classname was namespaced which is the conflict we have here.
Lets use his code.

Closing in favor of #18404

avatar Bakual Bakual - change - 26 Oct 2017
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2017-10-26 14:24:14
Closed_By Bakual
Labels Added: ?
avatar Bakual Bakual - close - 26 Oct 2017

Add a Comment

Login with GitHub to post a comment