Set the #maxlength property.
The default value is 128.
Suppose you have the following module. To your dismay, the value of the variable you think is global is not accessible:
$myvar = 'foo';
function example_something() {
global $myvar;
return $myvar; // returns NULL
}
From http://www.php.net/manual/en/function.include.php
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs.
As module files are loaded by drupal_load, it follows that $myvar is a variable declared in the local scope of the function drupal_load.
Use the global keyword or $GLOBALS superglobal.
// Declare and initialize $myvar as an explicit global:
global $myvar;
$myvar = 'foo';
// Or use the superglobal:
$GLOBALS['myvar'] = 'foo';
function example_something() {
global $myvar;
return $myvar; // returns 'foo'
}
[your_files_directory]/languages/ (if any)Then execute the following queries on the database (see settings.php for which database is in use):
UPDATE languages SET javascript = '' WHERE LANGUAGE = '[yourlanguage]';UPDATE variable SET VALUE = 'a:0:{}' WHERE name = 'javascript_parsed';TRUNCATE cache;If you now visit the relevant page, the translation will be regenerated.
If all your blocks disappear from the site the moment you add a hook_block implementation to your module, check whether you have a theme with the same name as your module.
Cause: The theme system uses your hook_block implementation as if it were a theme_block implementation.
Either rename your module or the theme.
admin/build/modules. The Devel module provides a block that has a menu rebuild shortcut.'page_callback' instead of the correct 'page callback'.Apart from obvious causes (module not enabled, update hook misnamed), there's a actual pitfall here; You cannot use mixed case filenames for modules.
Suppose you have a module Example with Example.module and Example.install as files. Example.install contains your Example_update_6001() function.
Update.php uses the PHP function get_defined_functions to enumerate update hooks. The function returns lowercase functionnames (PHP function names are case insensitive). Drupal, however, does a case-sensitive string compare (strpos) with the module name. These will never match.
Use all lowercase module names (example.module vs. Example.module, mymodule.module vs. MyModule.module). Alternatively, wait for a bugfix via Issue #200628.