This message appear since I have updated Link 1.0 to Link 1.1 :

Notice : Undefined property: stdClass::$node_title dans html_title_views_view_field__title() (ligne 108 dans /var/www/drupal7/sites/all/modules/html_title/html_title.module).

what could I do to fix this issue ?

thanks

Comments

rob_johnston’s picture

Title: Html_title » Notice: Undefined property: stdClass::$node_title in html_title_views_view_field__title()
Project: Link » HTML Title
Version: 7.x-1.1 » 7.x-1.x-dev

I see the same thing, but I would have filed the bug with the html_title module. Where I see the error is on the /admin/workbench/needs-review page:

Notice: Undefined property: stdClass::$node_title in html_title_views_view_field__title() (line 108 of C:\inetpub\wwwroot\sites\all\modules\html_title\html_title.module).

What I did was change the html_title_views_view_field__title() function in the html_title.module file to check if the node_title is set:

function html_title_views_view_field__title($variables) {
  // Strip tags instead of rendering for some types of views plugins
  if ($variables['view']->plugin_name == 'content_php_array_autocomplete') {
    return strip_tags($variables['row']->node_title);
  }

  // Store title and do XSS filtering
  $elements = variable_get('html_title_allowed_elements', array('em', 'sub', 'sup'));
  if (isset($variables['row']->node_title)) {
    $title = filter_xss($variables['row']->node_title, $elements);

    // Replace title with our placeholder
    $variables['row']->node_title = '%%%HTML_TITLE_PLACEHOLDER%%%';

    // Pass rendering on to the default rendering
    $output = $variables['view']->field['title']->advanced_render($variables['row']);

    // Restore our filtered title
    $output = str_replace('%%%HTML_TITLE_PLACEHOLDER%%%', $title, $output);

    return $output;
  }
  else {
    return $variables['view']->field['title']->advanced_render($variables['row']);
  }
}

Does that work for you? Anybody else who know this module well care to comment?

Anonymous’s picture

Thanks for the idea! This did work for me (though, be careful to remove the initial "<?php").

tangent’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Please check if this issue still exists in the latest dev build. That code has been replaced.

tangent’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)