Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct model helpers include paths (com_menus item, com_user debuguser and debuggroup) #11164

Closed

Conversation

andrepereiradasilva
Copy link
Contributor

@andrepereiradasilva andrepereiradasilva commented Jul 17, 2016

Summary of Changes

The include helper path in com_menus item, com_users debuguser and com_users debuggroup is not correct and when loading the model will generate a php fatal error.

Testing Instructions

  • Use latest staging
  • Add this lines to isis index.php
JLoader::register('MenusModelItem', JPATH_ADMINISTRATOR . '/components/com_menus/models/item.php');
$model = JModelLegacy::getInstance('Item', 'MenusModel', array('ignore_request' => true));

JLoader::register('UsersModelDebugUser', JPATH_ADMINISTRATOR . '/components/com_users/models/debuguser.php');
$model = JModelLegacy::getInstance('DebugUser', 'UsersModel', array('ignore_request' => true));

JLoader::register('UsersModelDebuggroup', JPATH_ADMINISTRATOR . '/components/com_users/models/debuggroup.php');
$model = JModelLegacy::getInstance('Debuggroup', 'UsersModel', array('ignore_request' => true));
  • Try to load any admin page. You get a Fatal error, you'll notice in the fatal error the patch where is trying to laod the helper is not correct.
Warning: require_once(/path/to/joomla-staging/administrator/components/com_xxxxxx/helpers/menus.php): failed to open stream: No such file or directory in /path/to/joomla-staging/administrator/components/com_menus/models/item.php on line 15
Fatal error: require_once(): Failed opening required '/path/to/joomla-staging/administrator/components/com_xxxxxx/helpers/menus.php' (include_path='/path/to/joomla-staging/') in /path/to/joomla-staging/administrator/components/com_menus/models/item.php on line 15
  • Apply this patch
  • Repeat process and confirm no fatal error now.
  • Check menu itmes works fine and debuguser and debuggroup work fine too
  • Do a simple code review (3 lines of code).

Notes

This problem was discovered when trying to load the menu items model in the GsoC 2016 Improved Multi-lingual Content Management

@andrepereiradasilva
Copy link
Contributor Author

@infograf768 @jreys @alikon please test

@andrepereiradasilva
Copy link
Contributor Author

andrepereiradasilva commented Jul 17, 2016

this is solved already in #10881

So i'm gone a close this one.

Please test #10881
thanks @mbabker

@andrepereiradasilva andrepereiradasilva deleted the fix-model-paths branch July 17, 2016 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants