Today in IRC we recognized through a member's problem, that lighbox2_preprocess_page() contains too much duplicate stuff from tempalte_preprocess_page(). As all registered preprocess are called each after another, they don't completely replace the function, but pass a the $variables by reference, so any function can edit them. For that less code would be needed, because template_preprocess_page() allready delas with most issues therein.
Especially a special problem occured regarding the $message variable (it contains system messages - status and error - set via drupal_set_message()). When theme('status_messages') is called a second time, because two preprocess (template_ & lightbox2_ call it, the message cache has allready been emptied, and so an empty $message-variable is being set. This leads to status messages that were never viewed to the user.
To reduce the duplicate entries in the preprocess I created attached patch.
There I also removed the template_files-suggestion procedure, because this is also allready performed by template_preprocess_page().
| Comment | File | Size | Author |
|---|---|---|---|
| lightbox2_prerpocess_page.patch | 6.17 KB | derhasi |
Comments
Comment #1
stella commentedcommitted, thanks!