Download & Extend

Preprocess_page let's messages disappear + Too much duplicate

Project:Lightbox2
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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().

AttachmentSize
lightbox2_prerpocess_page.patch6.17 KB

Comments

#1

Status:needs review» fixed

committed, thanks!

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here