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.
Hi
there is a bug with CCK user reference module, If i mark it as a required field, then the node can't be submited, it thorows error like that field is required (but it is filled)
I nitoced similar thing in another issues, e.g. filefield, so maybe it is some global bug. However, I could't put it into #problemss with non cck modules because this is core CCK module - user reference.
bye
Comment | File | Size | Author |
---|---|---|---|
#12 | conditional_fields-required-fields-722236-12.patch | 1.47 KB | johnnydarkko |
#11 | conditional_fields-required-fields-722236-11.patch | 1.47 KB | Matt-H |
#10 | conditional_fields-6.x-1.1.patch | 696 bytes | Matt-H |
#9 | conditional_fields.patch | 686 bytes | Matt-H |
#7 | conditional_fields.patch | 567 bytes | dalguete |
Comments
Comment #1
peterpoe CreditAttribution: peterpoe commentedWith the latest dev, I cannot reproduce exactly this bug.
I have tested these required user reference widgets:
- select (single and multiple)
- autocomplete
- radios
- checkboxes
In no case, I got a "required field" error when the field was not triggered.
I have found another issue though: with the radios widget, if no default value is set, the field is required and triggered, submitting the form without selecting any value will cause an "Illegal option detected" message.
Is that your case?
If not, could you export your content type so that I can test it?
Comment #2
zualas CreditAttribution: zualas commentedHello Peter,
Looks like if a radio field is selected as required, it must be triggered and filled, otherwise it shows the error "Illegal option detected". here's the test form that I used. Sorry it's a bit messy, I have many other modules installed. If that doesn't import, I can submit a clean version. My conditional fields version is 2.x dev
Thanks!
Comment #3
MilanT CreditAttribution: MilanT commentedI have the same problem as igorik; as does another employee of mine. Has a solution been discovered?
MT
Comment #4
Shadlington CreditAttribution: Shadlington commentedI have this problem too.
I have a required user reference field that is controlled by another field.
It doesn't matter what I do, if the field is visible (because the controlling checkbox is ticked) then when I try to submit the form it will complain that the user reference field is not filled.
Comment #5
martynpanes CreditAttribution: martynpanes commentedHave encountered this problem too - is there a patch available to fix it yet?
Comment #6
jjwhitney CreditAttribution: jjwhitney commentedI ran into this issue, too. Here's a patch, and it's pretty non-controversial.
Comment #7
dalguete CreditAttribution: dalguete commentedSame story when working with email fields. This patch includes user reference correction.
Comment #8
MEEfO CreditAttribution: MEEfO commentedI am experiencing the same problem with the Embedded Media Field module. I have enabled YouTube video uploads via Media: YouTube extension. Works flawlessly until I set a conditional field to trigger the Video field, and set the Video field to required. At that point no matter what I enter into the Video field it always throws a `Video field is required.' error on submit.
Are any patches available to address this issue?
Comment #9
Matt-H CreditAttribution: Matt-H commentedThere is the same problem with the Role Reference module. I've included another patch to accommodate that module (in addition to the user reference and email field.) I'm starting to wonder if some other approach with this check should be done, like perhaps a hook that other modules could use to add their checks, or maybe a registry of ids they could add to that this could go through. Or perhaps an inventory of similar cck field modules could be done to see what else should be added to this growing list (like Block Reference or View Reference, because they too may be affected.
Comment #10
Matt-H CreditAttribution: Matt-H commentedHere is the same patch as above, but for the 6.x-1.1 version.
Comment #11
Matt-H CreditAttribution: Matt-H commentedI've revisited this patch, addressing some of the issues I mentioned before. This patch now calls up a function that returns an array of id names - 'value' (normal field), 'nid' (Node reference), 'uid' (User reference), 'rid' (Role reference), and 'email' (email fields). That function actually invokes a hook to get the array values, so theoretically other modules could add their fields to that list (or people could write their own module to add the fields they need) and statically caches the list so the hook isn't called multiple times. This patch is for the now current 6.x-2.0 version.
Comment #12
johnnydarkko CreditAttribution: johnnydarkko commented#11 almost worked... thanks Matt-H! There was a missing closing parenthesis.
Verified that it fixes 6.x-2.0
Comment #13
Matt-H CreditAttribution: Matt-H commentedNo offense johnnydarkko, but are sure about that missing closing parenthesis?
patch-12 has:
+ if (!isset($ids) || $reset)) {
while patch-11 has:
+ if (!isset($ids) || $reset) {
It looks to me that patch-12 has an extra closing parenthesis. Am I missing something?
Comment #14
roball CreditAttribution: roball commentedI ran into the same problem, with a required Node reference field, using the latest 6.x-2.x-dev, which is 6.x-2.0+12-dev (2012-Aug-07). Patch #11 can't be applied anymore - could you please update it? Thanks!
Comment #15
peterpoe CreditAttribution: peterpoe as a volunteer commented