First of all, excuse my English.
I have a little testing site with Drupal 6.20 + CCK 3.0-alpha1 installed. I have made a custom node type for culinary recipes. This type includes optional multigroup Masterclass, which consist of two CCK fields: ImageField and TextArea, both marked as "required'.
Expected behaviour: user can fill optional master-class in recipe; in this case both fields of every subgroup of master-class must be filled. Or user can ignore master-class at all and leave it empty.
Actual behaviour: if master-class is not filled, user cannot save new node because of error: "Field required and must be filled" (actually another text in Russian but with the same meaning). And this error mention ImageField only, not a TextArea. The order of fields plays no role, only ImageField refered in the error.
Now I have to clear 'required' checkbox on ImageField field, but it definitely breaks the logic of master-class creation.
So, is there any way to workaround this problem? I can make any testing needed, but unfortunately I have no practice in PHP programming. :-(
Comments
Comment #1
RedRat commentedComment #2
xarbot commentedI'm having the same problem. Subscribe
Xarbot
Comment #3
karens commentedI think I have this fixed now.
Comment #4
xarbot commentedWhen i download the last alpha and upgraded i have this error
Cannot use a scalar value as an array a /SAN/ocw/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc a la línia 354.
Thanks in advanced
Xarbot
Comment #5
karens commentedWhat kind of field do you have on your form where you see this? That message would imply you have a form that has an object where there should be an array. I need more information about this to do anything with it.
Comment #6
sergmain commentedAn error 'Cannot use a scalar value as an array a /SAN/ocw/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc a la línia 354.'
completely reproducible in bug report http://drupal.org/node/1093928 with CCK 6.x-3.x-dev tar.gz 2011-Mar-16
Full error stack is
* warning: Cannot use a scalar value as an array in C:\opt\Apache2\htdocs\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 354.
* warning: Cannot use a scalar value as an array in C:\opt\Apache2\htdocs\modules\cck\modules\content_multigroup\content_multigroup.node_form.inc on line 354.
* warning: uasort() [function.uasort]: The argument should be an array in C:\opt\Apache2\htdocs\includes\common.inc on line 2944.
Bug report http://drupal.org/node/1094490 related to this issue too.
Comment #7
karens commentedFixed this issue. Looking at the others.
Comment #8
xarbot commentedHello:
I don't have this bug. But now when i select only field required of the multigroup, all the fields in the multigroups apeears as required.
Thanks in advanced
Xarbto
Comment #9
RedRat commentedAfter upgrading to alpha2 I have got this error:
Also, creating a content type with multigroup is impossible now: I got 500 error instead and this error in the log:
[Thu Mar 17 13:48:09 2011] [error] PHP Fatal error: Unsupported operand types in /arc/www/drupal/includes/common.inc on line 2946Do we need to reopen this issue or make a followup to http://drupal.org/node/1094490?
Comment #10
xarbot commentedInstall dev version. It's applied to dev version, not to alpha
Xarbot
Comment #11
karens commentedI need more information about the bug in #8, I don't understand what you're describing.
Comment #12
xarbot commentedOk:
Imagine you have 1 multigroup. Inside this you have 4 fields. You mark the first one as required. Then, the problem is that all fields in the group are marked as required.
See the images. In image 1 i marked only this field as required, but the forms are rendered all fields are marked as required (Image 2)
Thanks in advanced
Xarbot
Comment #13
RedRat commentedUpgraded to the latest 6.x-3.0-dev version (17 March), initial error still here: cannot save empty multigroup with image-field marked as 'required'. :-(
Comment #14
karens commentedFound the problem and committed a fix. I needed to use array_keys() on the required fields list.
Comment #15
xarbot commentedDo you commited to the dev version?
I continue with the same problem in #12, but i think that the dev version is the same as 3 hours ago
Thanks in advanced!!
Xarbot
Comment #16
karens commentedRe #12, imagefield had its own way of validating, had to make another fix to fool imagefield into leaving it alone for an empty group. I think empty groups with required fields are now passing through correctly.
Committed that much, now I need to test that empty required fields still get flagged as errors if the group is not empty.
Comment #17
karens commentedHad to add tweak so that required imagefields get highlighted correctly if empty in a non-empty group.
As far as I can see the current state of dev is handling required fields in non-required groups correctly. I'd appreciate it if others bang that around and be sure nothing is missing. Also test required fields in required groups to be sure they still work as they should.
Comment #18
RedRat commentedInitial bug is fixed in the dev as of March, 18, so now I can save nodes with empty multigroup.
Comment #19
xarbot commentedThe problem is not a imagefield field because is a file field, not imagefield field :P
I don't explain well :)
Imagine that you don't have the file field, the problem continues. When i put some field as required in multigroup all the fields in the multigroup are marked as required, and i only need only field required, not all.
Thanks in advanced
Xarbot
Comment #20
RedRat commentedTo xarbot: I have a multigroup consisted of two fields: imagefield and textarea, both marked as required. A minute ago I marked textarea field as non-required, and now it appears as non-required while content creation, just as expected. Are you sure that all your other fields, except needed one, marked as non-required?
Comment #21
xarbot commentedOk, i try with dev version of 18 March and #12 works well.
Now i have a problem with cck_scorm project.
Fatal error: Cannot use string offset as an array in /SAN/ocw/sites/all/modules/cck_scorm/SCORM_widget.inc on line 219
I push a issue in cck_scorm project too
Thanks in advanced
Xarbot
Comment #22
xarbot commentedSorry, but now i have this error
array_keys() [function.array-keys]: The first argument should be an array a /SAN/ocw/sites/all/modules/cck/modules/content_multigroup/content_multigroup.node_form.inc a la línia 281.
i delete the cck scorm field.
Thanks in advanced
Xarbot
Comment #23
karens commentedThis is not a catch-all issue for any problem you see. Please file separate reports for each issue.
If you see a problem related to some other module, start there, don't report it both here and there. If they decide it is a CCK issue they can move it back.
Comment #24
xarbot commentedOk, sorry i open a new issue
Thanks
Xarbot