As I understand it, it’s preferable that an add-on doesn’t add its own package path. I’m starting to remove the ee->load->add_package_path(PATH_THIRD.’low_whatevs’) references, but I’m running into an issue there.
In system/expressionengine/controllers/cp/addons_extensions.php, the extension class is loaded and initiated on line #365 thusly:
$OBJ = new $class_name();However, lots of times, my constructor loads stuff, and at this point, the package path hasn’t been added yet. It’s only loaded when settings_form is called, but the constructor has already fired by then.
Also, the path isn’t added when $OBJ->settings() is called, a few lines down.
So, perhaps change line #365 to this:
$this->load->add_package_path($ext_path, FALSE);
$OBJ = new $class_name();
$settings = method_exists($OBJ, 'settings') ? $OBJ->settings() : array();
$this->load->remove_package_path($ext_path);…and then change the $OBJ->settings() call in the foreach to $settings.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.