Hello,

since a few days I am getting these error prompts, more or less often, in some views (in others there's nothing). http://cl.ly/26073A09013v3x151b38

Unfortunately I am »just« the »developer«, not the maintainer of the Drupal installation. Therefore I am not aware, if there was an update or if there was a change on the module or the database. (And by now there is no chance to get these informations...)

The strange thing is, that I am not using relevant content in these views and on the other hand where I am using relevant content (as a field) everything works fine. But the lists of the prompts are getting longer and longer and it's really uncomfortable to handle the views with these huge error lists.

Would you be so kind and give me a hint, where I can look up to prevent the prompt and solve the error? What happend, what causes the problem?

Many greetings and thank you in advance,
Maria

Comments

fuse’s picture

+ 1

fuse’s picture

I get this error when there is a related content field that does not contain any items.

I solved it by doing the following:

relevant_content.module line 625

// Loop over all the items and create the field output
  foreach ($items as $item) {
	  
    // Depending on the type, render a field
	if( isset($item['nid']) ){
    
		switch ($item_style) {
		  default:
		  case 'default' :
			$result = l($item['title'], 'node/' . $item['nid']);
			break;
	
		  case 'plain' :
			$result = check_plain($item['title']);
			break;
	
		  case 'teaser' :
		  case 'full' :
			// TODO - make much better user of node_view_multiple()...
			// TODO - this isn't right...
			$node = node_load($item['nid']);
			$result = render(node_view_multiple(array($node->nid => $node), $item_style));
			break;
	
		  case 'token_full' :
		  case 'token_teaser' :
			// Run a token replace on the content
			$types = array('global' => NULL, 'node' => node_load($item['nid']));
	
			// Do a token replace on the pattern
			$result = token_replace($token_settings['value'], $types);
	
			// Do a check_markup. Needs to be done here due to the filter_xss bug on [node:url:relative]...
			$result = check_markup($result, $token_settings['format']);
			break;
		}

	}

    // Add the result as a row to the table
	if(isset($result)){
    	$element[$count] = array('#markup' => $result);
	}

So I added two if-statments to check if values are set. If someone now could make this a patch...

maerys’s picture

worked so far. thanks!