[themes] All page titles identical

Agon S. Buchholz asb at kefk.org
Sun Aug 21 11:20:58 UTC 2011


Progga wrote:

> Try calling "drupal_set_message(print_r(debug_backtrace(), TRUE))"
> from inside the drupal_set_title() function at "includes/path.inc,
> line 206".

Thanks for your patience, but I had no luck with this either.


function drupal_get_title() {
   $title = drupal_set_title();
   drupal_set_message(print_r(debug_backtrace(), TRUE))

   // during a bootstrap, menu.inc is not included and thus we cannot
provide a title
   if (!isset($title) && function_exists('menu_get_active_title')) {
     $title = check_plain(menu_get_active_title());
   }

   return $title;
}

and

function drupal_get_title() {
   $title = drupal_set_title();

   // during a bootstrap, menu.inc is not included and thus we cannot
provide a title
   if (!isset($title) && function_exists('menu_get_active_title')) {
     $title = check_plain(menu_get_active_title());
   }
   drupal_set_message(print_r(debug_backtrace(), TRUE))
   return $title;
}

result in:

Parse error: syntax error, unexpected T_IF in
/var/www/drupal/includes/path.inc on line 235

respctively

Parse error: syntax error, unexpected T_RETURN in
/var/www/drupal/includes/path.inc on line 239


(is this even "inside the function"?)


function drupal_set_title($title = NULL) {
drupal_set_message(print_r(debug_backtrace(), TRUE))
   static $stored_title;

results in

Parse error: syntax error, unexpected T_STATIC in
/var/www/drupal/includes/path.inc on line 253


function drupal_get_title() {
   $title = 
drupal_set_title(drupal_set_message(print_r(debug_backtrace(), TRUE)));

   // during a bootstrap, menu.inc is not included and thus we cannot 
provide a title
   if (!isset($title) && function_exists('menu_get_active_title')) {
     $title = check_plain(menu_get_active_title());
   }

results in lots of debug output all over the first page I', loading, and 
then in

Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to 
allocate 54190338 bytes) in /var/www/drupal/includes/theme.inc on line 1879

(current PHP memory limit: 200M)


Sorry, this is too much guesswork as I don't understand enough about PHP 
syntax.

E.g. "inside the function" 
drupal_set_title(check_plain($gallery->name)); probably means somewhere 
inside the first (), or second (), either before, or after 
"check_plain", or either before, or after "$gallery->name".

Greetings, -asb



More information about the themes mailing list