MyBB Community Forums

Full Version: Upgraded to 1.6.6 - Now A Plugin Is Stopping Me From Something
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys, I just upgraded to MyBB 1.6.6.
I don't know whether to post in MyBB Plugin support or here, so I cam here.
I am now getting this error when attempting to admincp.
Fatal error: Call to undefined method pluginSystem::run_hooks_by_ref() in /home/****censored****/public_html/admin/modules/newpoints/module_meta.php on line 49
I can't resolved this error because of something caused by newpoints,
any help?

edit: I am also unable to access any page in admin cp and now also unable to reopen my forum board because of this.
That is odd. I just upgraded and don't see any problems.
The code in the quotes looks correct, because the plugin system class/object is pluginSystem and run_hooks_by_ref is the function to run plugins, IIRC.

Are you using the latest NewPoints version (1.9.3)?
(2012-02-10, 04:18 AM)GamerVoid Wrote: [ -> ]That is odd. I just upgraded and don't see any problems.
The code in the quotes looks correct, because the plugin system class/object is pluginSystem and run_hooks_by_ref is the function to run plugins, IIRC.

Are you using the latest NewPoints version (1.9.3)?

Yes I am. Do you know how to fix this issue?
Hrmm. Could you post the code around line 49 in the aforementioned file?
(2012-02-10, 04:31 AM)GamerVoid Wrote: [ -> ]Hrmm. Could you post the code around line 49 in the aforementioned file?

Here is line 49:
	$plugins->run_hooks_by_ref("admin_newpoints_menu", $sub_menu);

EDIT:
Here is the code around it and the code
function newpoints_meta()
{
	global $page, $lang, $plugins;

	$sub_menu = array();
	$sub_menu['10'] = array("id" => "plugins", "title" => $lang->nav_plugins, "link" => "index.php?module=newpoints-plugins");
	$sub_menu['15'] = array("id" => "settings", "title" => $lang->nav_settings, "link" => "index.php?module=newpoints-settings");
	$sub_menu['20'] = array("id" => "log", "title" => $lang->nav_log, "link" => "index.php?module=newpoints-log");
	$sub_menu['25'] = array("id" => "maintenance", "title" => $lang->nav_maintenance, "link" => "index.php?module=newpoints-maintenance");
	$sub_menu['30'] = array("id" => "forumrules", "title" => $lang->nav_forumrules, "link" => "index.php?module=newpoints-forumrules");
	$sub_menu['35'] = array("id" => "grouprules", "title" => $lang->nav_grouprules, "link" => "index.php?module=newpoints-grouprules");
	$sub_menu['40'] = array("id" => "stats", "title" => $lang->nav_stats, "link" => "index.php?module=newpoints-stats");
	$sub_menu['45'] = array("id" => "upgrades", "title" => $lang->nav_upgrades, "link" => "index.php?module=newpoints-upgrades");
	
	$plugins->run_hooks_by_ref("admin_newpoints_menu", $sub_menu);
	
	$lang->load('newpoints');
	
	$page->add_menu_item($lang->newpoints, "newpoints", "index.php?module=newpoints", 60, $sub_menu);
	
	return true;
}

...
this is actually happening on ALL my new points pages using that methods.
Call to undefined method pluginSystem::run_hooks_by_ref() on all those pages.
should I just upload a fresh copy of newpoinys?
You might want to try reuploading core NewPoints files.
(2012-02-10, 05:46 AM)GamerVoid Wrote: [ -> ]You might want to try reuploading core NewPoints files.

Just reuploaded, still not working.
This happens on all new points files: Call to undefined method pluginSystem::run_hooks_by_ref()
Is there any way to disable new points and debug this issue?
You want to use $plugins->run_hooks instead of run_hooks_by_ref. I think the by_ref function was removed in 1.6.6

EDIT:

run_hooks_by_ref was removed in MyBB 1.6.6, however that change is only in the full package, the inc/class_plugins.php is missing in the changed files package. So only people on a fresh install or who used the full package to upgrade will see this error, if the plugin is actually calling run_hooks_by_ref
^ oh! so, what can be the temporary fix - do we have to use earlier class_plugins.php file ..
Well, the plugin just has to use run_hooks instead of run_hooks_by_ref - unless the mybb devs decide to put this function back in for backwards compatibility reasons

In MyBB 1.6.5/1.6.6 run_hooks does the by_ref too. Not sure how things are with older versions of MyBB, so if you want to support those too, you might have to check the mybb version number or check if the run_hooks_by_ref function exists in your plugin.
Pages: 1 2