Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When my anonymous user trying to create content profile during registrarion, he receive WSOD and this PHP Fatal error: Call to undefined function _content_is_empty() in /var/www/apache2/html/sites/all/modules/cck/cck/content.module on line 935
Comment | File | Size | Author |
---|---|---|---|
#36 | cck-content.module-541768-36.patch | 644 bytes | RoSk0 |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedit looks like some field in your profile does not have information about the module that implements that field. This could be a bug in content profile.
hook_content_is_empty() should be implemented by the module that implements the field. For example, text_content_is_empty() is implemented by text module, etc.
If this hook does not exist, then the bug is in the module that implements the field.
If this hook exists, but the script where it is implemented is not loaded, then this could be an indication of a bug somewhere in content profile.
This may also happen if someone tries to process a field implemented by a module that has been disabled/uninstalled. This indicates some kind of inconsistency in the database.
Comment #3
najibx CreditAttribution: najibx commentedI have checked that I have no missing fields (under manage field) for profile content type. but still getting this error. what best to trouble shoot this?
thanks!
Comment #4
monstordh CreditAttribution: monstordh commentedI'm having the same issue but it's related to CCK fields and the Image FUpload module. It happens when I am redirected to edit the captions for the images. I don't have Captions enabled, so this may be the issue.
Comment #5
markus_petrux CreditAttribution: markus_petrux commented@monstordh: Please, open a separate report in the FUpload module.
Please, refer to #1 to see why this error may happen.
Comment #6
lefnire CreditAttribution: lefnire commentedsame issue -- didn't show until I switch from 6.x-2.5 to 6.x-3.x-dev.
Of interest is that I checked "Use on Registration" on my content_profile node-type (Volunteer). Previously all the fields would show on registration (first name, last name, bio, bday, etc)... now only one field (bio) shows, and when I click submit I get that error.
Comment #7
bramface CreditAttribution: bramface commentedI got the same fatal error creating nodes through UC_Node_Checkout. It's on a shared server (LunarPages). On my development server, I did not get the error.
However, I made it go away by deleting the "email address" field I had added to the content types in question.
-Bram
Comment #8
Cristhian CreditAttribution: Cristhian commentedTake a look at #621346: Validate Multigroup (CCK3) Fields on User Registration Form
Comment #9
ccshannon CreditAttribution: ccshannon commented@monstordh: I am having the same problem trying to get FUpload working. I checked if you posted an issue in Image FUpload queue, but didn't find anything related to this. I created an issue for this problem, if you can add any information. Thanks.
#623342: Blank screen when hitting 'Done Editing' (CCK3)
Comment #10
skybow CreditAttribution: skybow commentedFunny enough, I once ran into this issue with the Content Profile's User referenced in #8, now I run into this issue again with Image FUpload as described in #4.
@markus_petrux:
Apart from the fact, that Image FUpload may have some problems of its own, I try to figure out, why it is a necessity to provide a $form in
content_multiple_value_nodeapi_validate
althoughnode_validate
allows to not specify the $form: (Prototype was taken from api.drupal.org)Shouldn't the code in
content_multiple_value_nodeapi_validate
be robust against not specifying a $form or not containing all the field info thatcontent_multiple_value_nodeapi_validate
expects?I changed the lines in content.node_form.inc around line 364 and the error in Image FUpload vanished.
The patch provided is against CCK-3-dev as of 3/3/2010
Comment #11
dpalmer CreditAttribution: dpalmer commentedHi Skybow, I'm experiencing the same issue on one of my sites after upgrading from Drupal 5 to 6. I tried applying your patch but I get this error:
1 out of 1 hunk FAILED -- saving rejects to file includes/content.node_form.inc.rej
I really need to get this back up and running so my users can create nodes, any help would be greatly appreciated.
Comment #12
skybow CreditAttribution: skybow commentedSounds as if you have problems applying the patch? Which version of CCK do you use?
The patch is targeted against the latest CCK 3 developer branch which is not directly available on the main CCK project page.
Comment #13
dpalmer CreditAttribution: dpalmer commentedSkybow, I was using CCK 2.x. It turns out the issue I experienced was due to forgetting 1 of the steps when upgrading from Drupal 5 to 6...I forgot to update CCK to the latest drupal 5.x version before upgrading drupal, so it was my bad ha. I ended up fixing it by reverting to that 5.x DB, re-performed the upgrade properly and now I am able to save nodes again. :D
Thanks for your help anyways.
Donovan
Comment #14
wayfarer_boy CreditAttribution: wayfarer_boy commentedThanks for the patch, skybow. I was experiencing this problem with CCK-3-dev (June release) and Content Profile 6.x-1.x-dev when adding new users (may have also been on new user registration form, didn't check). Your patch worked with no errors, and now the _content_is_empty() error does not appear (users can now register).
No subsequent issues found, but will report back if suspicious things start to happen! Thanks again.
Comment #15
design.er CreditAttribution: design.er commentedThank you very much for the patch, skybow. It fixed my WSOD problem with the Image FUpload module after hitting "Done Editing"... and also automatically fixed this issue: #473602: Uploaded CCK image thumbnails don't appear after "Next step".
Awesome... you made my day! :)
Comment #16
dspring0021 CreditAttribution: dspring0021 commentedI'm running CCK3 and tried to apply the patch and got a 'Hunk #1 FAILED at 361' as well.
***UPDATE***
Oops...submitted too soon. Tried to patch in the wrong directory. Seems to be working fine thus far. Thanks!
Comment #17
markus_petrux CreditAttribution: markus_petrux commented@skybow #10: While
node_validate()
could be invoked without a $form, the function your are patching will always get a $field, unless something odd happens with internal CCK data about fields. Let's see:Patch modifies last line like this:
However,
$field
is also used in that function before that line, which would be wrong if$field
can really be evaluated to FALSE.content_multiple_value_nodeapi_validate
is invoked bycontent_field()
like this:Since here we are also assuming
$field
contains valid data, rather than patchingcontent_multiple_value_nodeapi_validate
, we would have to come here to resolve that issue. However,$field
is passed tocontent_field()
as an argument, so we have to go up and see who is invokingcontent_field()
during anode_validate()
operation.content_field()
is invoked by_content_field_invoke_default()
like this:Ok, here we can see that
_content_field_invoke_default()
is reading field information based on:And now we need to analyze if it is really possible that that sentence sets
$type_name
with anything that will generate bad data during the next statement:And even in the case that
$type
is empty there, theforeach
loop wherecontent_field()
is invoked would do no iteration becasue $type['fields'] would be empty:In summary, IMO if CCK has to be patched to add defensive code against bad data, it would have to be done somewhere else, not in
content_multiple_value_nodeapi_validate()
, but defensive code is not a good solution because it could be hiding something that could be generating unexpected behaviors in any other place, and that could lead to a worst scenario. That's bad practice. When you detect that a data structure is bad, you should debug and fix that, patching to hide errors is a bad idea.This issue has been reported as a "bug report" against CCK, but that is completely wrong. There is something else odd in the site that needs to be anaylized and fixed. I'm leaving this issue as a "support request" and marked as fixed so it is still visible in the queue for a while.
Comment #19
yetiman CreditAttribution: yetiman commentedPatch still working here (CCK August 26 - 2010) !
Juste before I turn crazy.
First I try to apply the patch in the wrong directory... the good one is cck/includes.
Thanks
Comment #20
wayfarer_boy CreditAttribution: wayfarer_boy commentedSame problem occurs in the latest 6.x-3.x-dev (Nov 3rd). Luckily Skybow's patch still fixes with no errors.
Comment #21
wayfarer_boy CreditAttribution: wayfarer_boy commentedSorry, didn't read Markus' comment. Marking back to 'fixed'.
Comment #23
bjsomers CreditAttribution: bjsomers commented+1
Comment #24
kybermanThe same problem with actual dev version. Patch (now it's line 365) provisionally helped.
Comment #25
guybedford CreditAttribution: guybedford commentedThanks so much for this fix. On CCK-6.x-3.0-alpha3, I had to change the file - sites/all/modules/cck/includes/content.node_form.inc for line 365 as in #10.
Comment #26
mattcasey CreditAttribution: mattcasey commentedThis issue still exists in dev. +1 to having the fix committed
Comment #27
mattcasey CreditAttribution: mattcasey commentedThis problem comes back when I try to update CCK, so I rerolled the patch for latest version
Comment #28
retiredpro CreditAttribution: retiredpro commentedthanks mattwad. Your patch fixed my fupload issues. I've been using an older release of CCK 6-3.x-dev for a while now and I'm surprised this issue hasnt been fixed yet.
Comment #29
skylord CreditAttribution: skylord commentedWorks OK and helps with FUpload problems. Why hasn't it been commited yet?
Comment #30
strawheart CreditAttribution: strawheart commentedAttempted to patch 6.3 dev and got a 631 error.
Also, for the "Call to undefined function text_content_is_empty()..." error, I've had it happen on 6.2, 6.3 alpha and 6.3 dev. I gather from reading this thread that it may have to do with Content Profile; so just in case I updated that to the latest dev snapshot as well.
Other than that; I'm not sure what I can do to remove the error. The fact that it impedes users from saving nodes seems to be a pretty big deal. Let me know if you feel I'm missing something.
Comment #31
NathanM CreditAttribution: NathanM commentedWould also like to see this fix committed to dev. Very tiring to patch every time there is a new dev version released.
Comment #32
mattcasey CreditAttribution: mattcasey commentedbump. please let me know if there's anything else we can do to get this patch committed?
Comment #33
KarenS CreditAttribution: KarenS commentedThis is not a bug in CCK. As noted already it is a bug in other modules that are not passing the right values to CCK. If we let this bug go through by hiding the error message it just makes it appear that it is working right when it is not.
The bug has to be fixed in the modules that are causing the problems. Patching CCK is not a fix.
Comment #34
mattcasey CreditAttribution: mattcasey commentedAllright thanks for clarification. I will look into my issue with image fupload
Comment #35
mattcasey CreditAttribution: mattcasey commentedI think I found a solution to image_fupload, if anyone else is still looking: http://drupal.org/node/623342#comment-6061740. In that case, I noticed that $form was not being passed into node_validate() and #field_info was empty.
Comment #36
RoSk0The real issue is that boolean parameter $teaser, that can be also array of Form API is optional, but this doesn't get checked in content_multiple_value_nodeapi_validate() thus overriding completely valid data in $field param with NULL on includes/content.node_form.inc:351.
Comment #37
happyjoker CreditAttribution: happyjoker commentedAbout me, Im get this issue when Im build a new type of filed, and set default option for select list, select list its without key, and the data is big,
so when Im try to save field, its give me an error for undefined function _content_is_empty(), And Im solve this problem by add this
this function was set an index for empty index .. and the problem was resolved .
this about my Experience about this error, not for resolve problem, Im set it if its can be hive any help or idea ..
Comment #38
atong_mu CreditAttribution: atong_mu commentedthe patch posted by RoSko fixed the problem with image fupload, no more content_is_empty error from cck. thanks a lot
Comment #39
kyberman