[themes] All page titles identical

Matt Murphy mattyhead at gmail.com
Sun Aug 21 11:43:23 UTC 2011


Because print_r is a direct output function.  You'd need some sort of
buffering scheme to grab its output in chunks and assign it to a
variable or put it in the database or whatever, once per usage.

On Sun, Aug 21, 2011 at 7:20 AM, Agon S. Buchholz <asb at kefk.org> wrote:
> 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
>
> _______________________________________________
> themes mailing list
> themes at drupal.org
> http://lists.drupal.org/mailman/listinfo/themes
>


More information about the themes mailing list