FAQ
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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdevelopment @
categoriesdrupal
postedMay 11, '09 at 9:28a
activeMay 11, '09 at 9:28a
posts1
users1
websitedrupal.org
irc#drupal

1 user in discussion

Daniel Caillibaud: 1 post

People

Translate

site design / logo © 2022 Grokbase