View Issue Details

IDProjectCategoryView StatusLast Update
0012629mantisbtplug-inspublic2011-03-25 09:50
Reportercas Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status newResolutionopen 
Product Version1.2.4 
Summary0012629: Conditions in the init routine of plugin fail
Description

In my plugin I wanted activate an event based upon config of the plugin.
However, i end up with a error message like:
Fatal error: Call to undefined function auth_is_user_authenticated() in D:\xampp\htdocs\m120\core\config_api.php on line 84

The code I use is:
$showmenu = plugin_config_get( 'tasks_show_menu' );
if (ON == $showmenu){
plugin_event_hook( 'EVENT_MENU_MAIN', 'tasks_menu1' );
} else {
plugin_event_hook( 'EVENT_MYVIEW', 'tasks_view' );
}

Is there a correct option to achieve this behavior?

Additional Information

I also tried to have this setting in config_inc.php by having the following line:
$showmenu = config_get( 'tasks_show_menu' );

This gave exactly the same result.

I have tried both within the init routine and hook routine, again same result.

TagsNo tags attached.

Activities

cas

cas

2011-01-03 11:10

reporter   ~0027785

Still have this issue.
If i use a statement like:
if (5<0) {
all works fine.
Refering to (plugin_)config_get just returns a blank screen or the error message as mentioned above.
Can someone shed some light on this issue?

cas

cas

2011-01-31 05:59

reporter   ~0028120

Can this issue be acknowledged as indeed to be an issue or am I overseeing something here?

cas

cas

2011-02-22 06:04

reporter   ~0028275

Since there is no real feedback on this issue, i found a way around.
I add the configuration option to config_inc.php and read that setting like :
config_get_global( 'tasks_show_menu' );
Now there is no error message.
This is NOT a preferred solution.

To me it seems that we need a special routine that can read such plugin settings without authenticating the users.
Perhaps something to include in 1.3?

cas

cas

2011-03-25 09:50

reporter   ~0028481

Any feedback on this issue?