I originally posted this as a bug under the CCK fieldgroup module (http://drupal.org/node/168045), but haven't had any response so I'm hoping someone here can help. I can't tell if it is a usernode problem or a CCK problem.
I've created custom profiles using usernode and CCK (not nodeprofile). I've added quite a few custom fields for the usernode content type, and have thus enabled the fieldgroup.module to keep things tidy. For the usernodes that already exist, all is fine and good. The problem comes when I create a new user account and attempt to login. Upon login (which is successful), the following error message is given when the user is taken to his/her usernode/profile page:
warning: Invalid argument supplied for foreach() in /home/website/public_html/drupal/sites/all/modules/cck/fieldgroup.module on line 394.
This may be related to the fact that the new node usernode creates for a user does not automatically populate any of the custom fields...?
As I said, I'm not sure if this is a problem with usernode or cck. It seems similar to this problem: http://drupal.org/node/156598. Any assistance would be much appreciated. Here's some relevant info about my setup:
Drupal 5.2
CCK 5.x-1.6
Usernode 5.x-1.2
Contemplate 5.x-1.3
Comments
Comment #1
holydrupal commentedThe error appearing in the frontage so I think the priority must be Critical.
I enabled CCK and Profile module and make a CCK content and the above mentioned error appeared.
any idea?
Comment #2
owen barton commentedPlease do not change the title...
Comment #3
dkruglyak commentedI wonder if the error is related to the issue I reported here (with the fix) http://drupal.org/node/172863. I also have the fieldgroup module enabled and had similar error messages (not sure if I can reproduce after applying my patches).
Comment #4
spazfoxThanks for the tip, dkruglyak, but applying your patch at http://drupal.org/node/172863 did not fix my problem (I was sure to disable and re-enable usernode after applying, too). :(
Alas, I'm about ready to give up on usernode, as this is a critical bug that is preventing the further development of my site...
Comment #5
dkruglyak commentedIf you apply the patch you need to reinstall the module... The problem (IMHO) is that initial usernode creation fails on install, but works afterwards. You could also set the variable driving further usernode checking by running custom PHP.
Comment #6
fagoperhaps you have set some fields to required which can't work.. as they are empty, when usernodes are created? usernode just uses drupal_execute() to create a usernode - which should work and does without cck fields. If it doesn't and you don't use required fields, it's most likely a bug of CCK, fieldgroup or a cck field.
It's not critical, as it doesn't affect usual usernode behavior - without cck fields.
Comment #7
dkruglyak commentedWell, in the real world we do have CCK fields, fieldgroups, required fields, etc. and have to deal with these problems. This is not something to sweep under the rug, wherever the bug might be.
I do think though there might be systemic problems with drupal_execute (like described here http://drupal.org/node/169723)
Comment #8
bengtan commentedSee http://drupal.org/node/168045 if that helps.
Comment #9
spazfoxThe solution offered at http://drupal.org/node/168045 removed the fieldgroup.module error, but usernodes are still not being created. *sigh*.... any other ideas?
Comment #10
fagoprobably you get not no usernodes, but empty, not valid nodes (=bug). the fieldgroup module errors are just the outcome of that.
the question is what usernode stops working.. if you experience problems identify the module making troubles with usernode by disabling modules until it works
Comment #11
stevectorPossible solution: Set cck fields to "multiple values."
I'm building a site that relies heavily on usernodes and was very surprised that when I added a nodereference cck field (to reference an image to serve as a larger profile image) to the usernodes content type, my usernodes were no longer being created automatically with registration of new users.
Essentially I think I was having the same problem described on this thread on others.
Over two hours I tried a variety of things and after looking at my phpMyAdmin page I remembered that if I set a cck field to "multiple values" it would move that field out of the table "content_type_usernode" and into a table of its own.
I have no idea if this difference in table structure is the reason it works. I just know it works and my usernodes are being automatically created and have a nodereference field. Hope this works for other content types.
Comment #12
robertgarrigos commentedThis is a general problem triggered, indeed, by http://drupal.org/node/169723 . I encountered to have a problem with no usernodes being created when having date_popup module activated. In this case, its implementation of the hook_form_alter was the problem, as this module needs to include some files when running. However drupal_execute (used by usernode module to create the node for each user) does not include any needed file by any other module, thus a bug it's been triggered and no usernode is created.
I would say that other implementations of hook_form_alter my be also the cause of this problem. My workaround was skipping that hook implementation in case the form being altered was usernode. It's kind of weird but it's a solution if you want to keep the module which is triggering the problem. In this case I did it by adding
with in this code in date_popup.module
like this
Hope this helps.
Comment #13
gomjabbaar commentedrobertgarrigos,
many thanks, that indeed helped a lot :)
edit : fixed to me
Comment #14
marcoBauli commentedthanks for that, it fixed things here too :)