Needs work
Project:
Node Widget
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2010 at 00:57 UTC
Updated:
3 Nov 2011 at 10:22 UTC
Jump to comment: Most recent file
I have an int cck field that is a select list (thus data is in this field at all times). It's required on the referenced node. Currently I get "Title field is required" because this is set and the title is not. I would assume skip would skip validate but it currently doesn't. Need some help with this one.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | node-widget-series-of-fixes.patch | 4.01 KB | nielsvm |
Comments
Comment #1
ademarco commentedFixed in last commit to HEAD: http://drupal.org/cvs?commit=363920
Comment #2
mikeytown2 commentedStill doesn't do it for me. In node_widget.form.inc at the top of the node_widget_node_form_validate() & node_widget_node_form_submit() functions I put this code in to not run the rest of the code if skip is present. This works for me, but is not generalized.
Comment #3
crystal_alexandre_froger commentedDoesn't work for me either.
Comment #4
Jon_B commentedMaking @mikeytown2 fix a bit more robust, in /node_widget/includes/node_widget.form.inc, change the function to:
Comment #5
arski commentedJust got the latest dev and have the same issue. Thanks a lot for fixing!
PS. How about turning "skip" into a js-button that removes that subform? or should i create a separate issue for that :)
Thanks again!
Comment #6
lpedretti commentedAnother interesting change, node_widget.form.inc , line ~ 140
This makes the skip checkbox default to true when adding empty subforms but not in existing relations subforms.
Comment #7
Crom commentedNice module and great work on patches here. I can confirm that #4 and #6 work - thank you.
It strikes me that the user experience (especially for end users) would be much improved if we could get rid of the 'skip' link entirely. Would the following have merit? A blank sub-form is available underneath any populated sub-forms (as currently). Skip is pre-checked on the blank sub-form and when content is entered into the empty sub-form skip is unchecked by JS. Alternatively, the check is done in PHP and the sub-form either saved or not saved depending upon whether it has any content in it.
I haven't delved into the code but if someone can give me some feedback on the viability of this idea then I might give it a go.
Cheers,
Crom
Comment #8
rustam6996 commentedTry change file nide_widget.class.inc in function submit($delta)
from
elseif (!$this->is_empty($form, $form_state)) {to
elseif (!$form_state['values']['remove'] && !$this->is_empty($form, $form_state)) {And all works, best regards from Russia ^)
Comment #9
nielsvm commentedThanks guys, many of these changes fixed my current project. For those interested, I've incorporated and fully tested the above snippets into one big patch against version 6.x-1.0-beta4 of node_widget (which seems completely unmaintained now), the missing references found in other issues is also in. Please apply the patch from the root of your project, assuming node_widget is inside contrib/:
patch -p1 --dry-run < node-widget-series-of-fixes.patch
Regards,
Niels