hook_content_is_empty() is not implemented

aries - December 13, 2008 - 12:44
Project:Relevant Content
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Hi,

Sometimes i get this when I submit a content:

Fatal error: Call to undefined function relevant_content_cck_content_is_empty() in content.module on line 892

AttachmentSize
relevant_content_hook_is_content_empty.patch373 bytes

#1

nicholasThompson - December 16, 2008 - 06:03

Hmmm thanks! I'll have to take a look into this hook. Does it really only need to return TRUE?

#2

aries - December 30, 2008 - 10:26

AFAIK it's content is always empty.

#3

nicholasThompson - December 30, 2008 - 10:50

According to....
http://drupal.org/node/191796#191796-misc

It looks like the hook should probably be looking in the result set to see if there *are* any relevant nodes, then based on the result return TRUE or FALSE depending on if the result is empty or not...

I'll need to examine some other modules to see how this works.

Cheers,
Nick

#4

aries - December 30, 2008 - 13:05

I think we're in the same shoes as with the computed field. It's a function to remove the unnecessary values at node saving.

If a specified number of multiple values was requested or this is the zero delta, save even if empty and keep a NULL value for each of its columns so there is a marker row in the database, otherwise unset the item.

This means for me that we have to return always TRUE, because there's no field what we filled. Otherwise you'll gave empty records in the database.

I might be wrong, i haven't had time to check the other usage of this hook.

#5

kostajh - October 21, 2009 - 04:36
Priority:normal» critical

I had to disable this module because my users could no longer enter content — they were greeted with this error message instead. Is there a fix for this?

#6

maxelrod - October 23, 2009 - 17:57

I have encountered this bug also, apparently the patch is not in the 9/17 dev yet. (which I am using)

I encountered this when using the main drupal content list screen to change the published status of several nodes that content relevant_content cck fields.

Note:for production sites with error reporting turned off it causes a WSOD, by the way.

I am going to try implementing the above patch. Perhaps the patch could be put in dev?

Mike

 
 

Drupal is a registered trademark of Dries Buytaert.