Hello. I am seeing a bad interaction between usernode.module and number.module. It might actually be a bug in content.module itself. It's very complicated and i've been struggling with it for days .... but to summarize: When the usernode has a cck multiple integer field, one of its possble values is 1, and that value is selected as a default, then the default seems to be loaded as boolean TRUE instead of int 1. This later causes validation to fail, so the usernode does not get created.

More details: this is a field with multiple integer values allowed: 1, 2 or 3. (The widget is multiple-checkbox.) Setting 2 or 3 as a default does not seem to be a problem, but setting 1 causes this failure. (BTW we originally had our values as 0, 1, and 2, but the 0 was even more problematic: it kept being stored in the DB as NULL!) Editing the node with a normal node form doesn't seem to be a problem, but usernode.module uses drupal_execute(). usernode.module also supresses all drupal_set_message() output during that drupal_execute(); comment that out on lines 233 & 239 to see the actual error message from array_key_exists().

The failure actually happens at line 144 of number.module, where array_key_exists() is called with its first arg being that boolean TRUE. (I fixed it with a hack: i check for a bool there and cast it to an int. Works for me, but wtf is it a bool in the first place?)

I have spent a lot of time chasing through CCK with xdebug, but the comments are few & i don't really get what's going on there half the time. I'll gladly experiment more if anybody has suggestions.

Comments

Leeteq’s picture

Would using 101, 102, 103, etc. instead of 1,2,3, etc. be a functional temporary workaround?

karens’s picture

Status: Active » Closed (duplicate)

Probably related to the drupal_execute() problem at #128038: Critical failures using drupal_execute() on nodes with CCK fields.

steev’s picture

Version: 5.x-1.7 » 5.x-1.10
Priority: Critical » Normal
Status: Closed (duplicate) » Needs review

I don't think this issue is actually related and hence a dupe because I can confirm it is still happening even with version 1.10 of the module, the newest version of usernode module, and D5.20.

The related thread was marked fixed but this bug is not fixed.

It can be reproduced, I think, by putting number fields on usernode, then trying to create a new user. User gets created but when trying to save new connected usernode if you leave any number fields blank, the usernode is not actually saved (fails silently).

karens’s picture

Status: Needs review » Closed (won't fix)

The D5 version is no longer being supported. Sorry.