JustCarmen/justlight_theme_options

Custom module and justlight theme options

Closed this issue · 2 comments

wooc commented

One of my custom module uses
controller->addInlineJavascript() function in the getMenu() function.

When I try to sort menu in your theme it trows:
Fatal error: Call to a member function addInlineJavascript() on a non-object in \modules_v3\wooc_module\module.php on line 152

The custom module shouldn't load the javascript in the control panel, because it is not necessary there.

Your custom module should use:
if (Theme::theme()->themeId() !== '_administration') {
$controller->addInlineJavascript();
}

The custom module you are talking about doesn't happen to be the custom javascript module, is it?
Because in that module this error is fixed. You can download the latest version from the add-ons section on the wt forum.

wooc commented

Thanks.