11 May
2009
11 May
'09
11:28 a.m.
Hi, In hook enable (mymodule.install file), drupal_set_message throws a fatal error, but only if called in a if { bloc }. Strange isn't it ? This is the code, tested with php 5.2.6 define('DEBUG', TRUE); function mytestmodule_enable() { // this line throws Fatal error: Call to undefined function drupal_set_message() // if (function_exists('drupal_set_message')) { drupal_set_message("fct mytestmodule_enable"); } // but this one don't (if previous line disabled) drupal_set_message("fct mytestmodule_enable"); // and this one also throws the fatal error //if (DEBUG) { drupal_set_message("fct mytestmodule_enable"); } } -- Daniel