MyBB Community Forums
[Rejected] ACP - Error with php option when plugin deactivated - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Rejected (https://community.mybb.com/forum-184.html)
+----- Thread: [Rejected] ACP - Error with php option when plugin deactivated (/thread-220049.html)



ACP - Error with php option when plugin deactivated - Crazycat - 2018-10-03

Hello there,

I'd created a plugin (ABP Solve It !) which use a php setting:
array(
   'name' => CN_ABPSOLVEIT . '_prefix', // Added in 0.2
   'title' => $lang->abp_sis5_tit,
   'description' => $lang->abp_sis5_desc,
   'optionscode' => 'php
".abp_solveit_listprefixes()."',
   'value' => '-1',
   'disporder' => 5
);

When I deactivate the plugin, I can alway go in its settings, I got:
Fatal error: Uncaught Error: Call to undefined function abp_solveit_listprefixes() in C:\wamp64\www\mybb\admin\modules\config\settings.php(1354) : eval()'d code on line 2
Error: Call to undefined function abp_solveit_listprefixes() in C:\wamp64\www\mybb\admin\modules\config\settings.php(1354) : eval()'d code on line 2

I guess the plugin file is not loaded but the settings from the databases are loaded, so the plugin function can't be found.
Is there a way to bypass this in the plugin(*) or any php setting will make an error when plugin is just deactivated ?

(*) Another way than replace the function by all its content