? ? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
15 Apr 2015

Issue

When the menu rebuild fails, a fatal error occurs since the model doesn't support a getMessage method. Also the language string it tries to use, doesn't exist.

Solution

Use getError instead of getMessage and add the language string.

Testing

To reproduce the issue you need to get the rebuild to fail. For that you can go to the #__menu table and delete the first row (id 1, root). That will break the nested set for sure.

See that you get a fatal error.
After applying the PR, you will get an error show that the rebuild failed with a lengthy exception message,

avatar Bakual Bakual - open - 15 Apr 2015
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2015
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2015
Labels Added: ? ?
avatar sovainfo
sovainfo - comment - 15 Apr 2015

Error

Rebuild failed: exception 'UnexpectedValueException' with message 'MenusTableMenu::getRootId' in
C:\xampp\htdocs\J3x\J34\j341\libraries\joomla\table\nested.php:1270
Stack trace:
#0 C:\xampp\htdocs\J3x\J34\j341\libraries\joomla\table\nested.php(1297): JTableNested->getRootId()
#1 C:\xampp\htdocs\J3x\J34\j341\administrator\components\com_menus\models\item.php(1108): JTableNested->rebuild()
#2 C:\xampp\htdocs\J3x\J34\j341\administrator\components\com_menus\controllers\menus.php(108): MenusModelItem->rebuild()
#3 C:\xampp\htdocs\J3x\J34\j341\libraries\legacy\controller\legacy.php(728): MenusControllerMenus->rebuild()
#4 C:\xampp\htdocs\J3x\J34\j341\administrator\components\com_menus\menus.php(18): JControllerLegacy->execute('rebuild')
#5 C:\xampp\htdocs\J3x\J34\j341\libraries\cms\component\helper.php(391): require_once('C:\xampp\htdocs...')
#6 C:\xampp\htdocs\J3x\J34\j341\libraries\cms\component\helper.php(371): JComponentHelper::executeComponent('C:\xampp\htdocs...')
#7 C:\xampp\htdocs\J3x\J34\j341\libraries\cms\application\administrator.php(98): JComponentHelper::renderComponent('com_menus')
#8 C:\xampp\htdocs\J3x\J34\j341\libraries\cms\application\administrator.php(152): JApplicationAdministrator->dispatch()
#9 C:\xampp\htdocs\J3x\J34\j341\libraries\cms\application\cms.php(252): JApplicationAdministrator->doExecute()
#10 C:\xampp\htdocs\J3x\J34\j341\administrator\index.php(42): JApplicationCms->execute()
#11 {main}

Expected:
Error

Rebuild failed due to database error.


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

avatar sovainfo sovainfo - test_item - 15 Apr 2015 - Tested unsuccessfully
avatar Bakual
Bakual - comment - 15 Apr 2015

We can change the message to something more general and remove the sprintf / getError stuff completely.
I just don't know if there are more than one way to break the rebuild.

avatar wilsonge
wilsonge - comment - 15 Apr 2015

See Bakual#3

avatar Bakual Bakual - change - 15 Apr 2015
Title
[fix] getMessage doesn't exist, use getError instead.
[fix] getMessage doesn't exist, use getError instead.
avatar zero-24 zero-24 - change - 29 Apr 2015
Category Administration
avatar zero-24 zero-24 - change - 29 Apr 2015
Title
[fix] getMessage doesn't exist, use getError instead.
[fix] getMessage doesn't exist, use getError instead.
Easy No Yes
avatar zero-24 zero-24 - alter_testresult - 29 Apr 2015 - sovainfo: Not tested
avatar Kubik-Rubik Kubik-Rubik - test_item - 9 Jul 2015 - Tested successfully
avatar Kubik-Rubik Kubik-Rubik - alter_testresult - 9 Jul 2015 - wilsonge: Tested successfully
avatar Kubik-Rubik Kubik-Rubik - change - 9 Jul 2015
Labels Added: ?
avatar Kubik-Rubik
Kubik-Rubik - comment - 9 Jul 2015

Thank you @Bakual! Merged.

avatar Bakual Bakual - change - 9 Jul 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-07-09 20:12:37
Closed_By Bakual
avatar Bakual Bakual - close - 9 Jul 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment