Closed (won't fix)
Project:
Editable Fields
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jan 2009 at 09:15 UTC
Updated:
10 Sep 2013 at 01:16 UTC
Hello and thanks for the great module!
I am using drupal 6.8, and CKK current dev, and while Single on/off checkboxes appear editable(they gray out for an instance when you press the checkbox) they neither do change status nor is the change being stored. Any clues? Thanks!
Comments
Comment #1
markfoodyburton commentedLooks like your using the 'dev' code - could you try using the 6.x.1.1 version, just to see if it's a bug I've just introduced, or not?
I assume you have permissions to edit the field etc? :-)
Cheers
Mark.
Comment #2
chrisroditis commentedTried with 1.1 release, problem persists. Permissions are set ok.
The problem is both with Firefox and IE7. Internet explorer is just popping up these messages:
"an error occured at ?q=/editablefields_html/6/field_task_completed"
The same goes for radio buttons, as in "check boxes/radio buttons" cck widget. The only thing I've tested and works so far is the "select list" and the "textarea" widget .
Comment #3
markfoodyburton commentedOK, I'll look into this again :-)
Comment #4
chrisroditis commentedThank you for your quick response! i appreciate it!
Comment #5
markfoodyburton commentedThanks Christopher for finding this problem....
So, if the check box has only 1 value, then it seems - even for a normal field, you can's select the tick box and save, it just stays unselected....
So, you need two values... fair enough... whats the use otherwise :-)
With 2 values, everything seems to work fine.... or at least, when the node is saved with the checkbox unticked, everything is fine, and you can use editable fields to 'tick' the checkbox, and the node is saved... all is fine.
The interest comes when you try and untick a checkbox.
Seems like the serialized data from serialize() doesn't give any values for the unselected checkboxes!
You can see that here:
http://docs.jquery.com/Ajax/serialize
Now, interestingly, this means that for multiple checkboxes, so long as you are not unchecking the last checkbox, you will actually be OK, and radio's should work fine.... but...
I was relying on some data being sent, however, I've changed things a bit, and the CVS now has a working version I believe. - Again, feedback MUCH appreciated....
Again, I'd like feedback. Please not, the CVS head required the very latest CCK (from the CVS as well)....
Until CCK is released, I wont release editablefields, but this means others may find this bug in the released packages until then.
Cheers
Mark.
Comment #6
markus_petrux commentedStill happens, before and after applying the patch in #352884: Clean up and fixing coding standards
It also happens an issue when you have an optionwidgets element with unlimited number of multiple values, rendered as checkboxes. The problem is that the formatter is called for each option. If there is no option is enabled in the database, then no widget is generated. If one option is enabled, then you get one widget, but if you have more options enabled, then you have a lot of widgets rendered.
This kind of problems may also happen with CCK fields that manage their own multiple values. Being the more complex scenario when the multigroup module is involved.
I believe the problem is using a div in the formatter to trigger the element form generation. A second problem comes by the fact that using drupal_execute using the $_POST array is not equivalent to sending a form. There may be situations, like the one happening with checkboxes because the browser does not send them when unchecked. There may be other problems that the FormAPI solves using value callbacks. And again, the more complex situation when the multigroup module is involved.
Comment #7
markfoodyburton commentedMarkus, can you confirm that the code in the CVS fixes the problem - I think the problem was related to an assumption about hoe serialize worked.... I think it should be fixed now... please advise?
cheers
Mark.
Comment #8
markus_petrux commentedNope. The code in CVS does not fix the problem, and so I did not fixed in the lastest patch in #352884: Clean up and fixing coding standards
If you apply that patch, then try this mini-patch on that:
That fixed the problem with on/off widgets on my system, but the other problems I mentioned in #6 above still remain.
I'm not really sure how to solve the heart of the issue. Maybe generating a form normally, rendering only the part that affects a particular field (probably using a different method to trigger this), and then sending the whole form as if it was from node edit.
Comment #9
markfoodyburton commentedCommitted
(See other thread as well, but, on this side, I'm not sure why this is necessary on your setup, I didn't seem to need it. It seems to be 'belt and braces' (more than we need), but - I can't see the harm in doing it, so - :-) )
THANKS for all the help with this module!
Cheers
Mark.
Comment #10
markfoodyburton commented#6 and...
I'm not really sure how to solve the heart of the issue. Maybe generating a form normally, rendering only the part that affects a particular field (probably using a different method to trigger this), and then sending the whole form as if it was from node edit.
I'm not sure what your getting at here?
Can you give me an example?
For sure, multigroups wont work quite right, but, I have an example where a multigroup at least shows all the groups that have been entered using an edit form - you can't add a new entry of course, but existing entries work....
I'm not sure I like your plan of building the whole form and then rendering only part of it. It feels to close to what I was doing for the D5 version, which ended up being a mess..... I'd rather use the cck hooks for the field...
Of course, because we are using this hook, the problem of not being able to handle multiple entries etc must also happen on the default-setting dialogue for a field. So, my view is, if/when somebody cares to fix that, then editable fields will benefit from that fix, but it shouldn't be fixed in editable fields.... do you agree?
(hopefully not, and hopefully you'll have already rolled a fantastic patch, given you work faster that the speed of light :-) :-) )
Comment #11
chrisroditis commentedConfirmed, latest release fixes the issue with on/off checkboxes! Thanks!
Comment #12
markfoodyburton commentedI believe this is now fixed properly
First up, modules that opt out of cck CORE for 'multiple fields' are assumed to load and save the entire multiple set of values together. So, on the display side, only one form element will be generated for all elements. Likewise, on the submit side, the code will store the entire result of the submit, rather than just attempting to store one element.
The result of this is that non-CORE multi-fields will _NOT_ work within the context of a multigroup.
If there are modules that opt OUT of 'cck core' but use the 'delta' mechanism - I dont know if this is legal or possible - then they will be broken.
Comments?
Comment #13
burningdog commentedThis is still broken for me using editablefields 6.x-1.x-dev and cck 6.x-2.x-dev (2009-Mar-15 version). I have a single on/off checkbox with 2 values:
When I view my node and check the field, it works fine; unchecking it does nothing. My checkbox is in a content type I've created, along with a lot of other fields. It's not in a fieldgroup.
Just to test, I've also added a new single on/off checkbox to my "Page" content type and after adding a "test" page node, checked and unchecked the checkbox. Same results: checking works, but unchecking doesn't.
Other people have got this right (#11) - what have I missed that I've done differently?
Comment #14
markfoodyburton commentedjust to see - could you give the thing a 3rd value - or make it optional - so this becomes a pull down - see if it works then?
Cheers
Mark.
Comment #15
burningdog commentedI hadn't marked the checkbox as "required" originally. It's a single on/off checkbox, so I guess giving it a 3rd option will give you some more information about my error? Ok, I've given it a 3rd option, set it to "editable" in my view, then check it in the view - and it saves as checked. When I uncheck it, the "processing" image turns a bit (like it's saving) and the checkbox greys out, then it becomes editable again, with the check still there.
If I change the widget type to "Check boxes/radio boxes" and give it 3 options, then when I edit it in my view it saves perfectly.
So I think it's just the single on/off checkbox which messes up. Is there anything else you'd like me to try?
Comment #16
markfoodyburton commentedMmm, ok - well thanks for that - I'm not sure when I'll get to look at this problem - I'll try sometime next week. Feel free to have a look yourself, or ping me next week if you hear nothing :-)
Cheers
Mark.
Comment #17
zmove commentedI confirm the issue, on/off checkbox are still very bugged.
/subscribe
Comment #18
Xangis commentedI just updated from Drupal 5.x-1.10 to 6.x-2.2 following the update instructions and am also having a problem with checkboxes. They will display on a form, but cannot be edited (if I check one and save it, it will not save). Also, checkboxes that are stored in the database as checked are not displayed as checked (as if the query was broken and failed silently). I would be happy to provide more information if it would be helpful.
Comment #19
zmove commentedHi,
The issue is still here with CCK 2.4 stable. Tried with both 1.2 and dev version of editablefields.
Any news about it ?
Comment #20
ermannob commentedsubscribing...
thanks
Comment #21
magnestyuk commentedsubscribe
Comment #22
seancr commentedI've experienced the same thing on a relatively new install with the recommended/supported versions of modules. I used taxonomy to work around this in the mean time.
Comment #23
stickybenson commentedNew install of Drupal 6.13, added three modules: cck, ajax_load, and the latest version of editablefields (March 23rd).
Experiencing exact same single checkbox issue of it not saving the unchecked mode.
subscribed.
Comment #24
zmove commentedHi,
I bump this bug because I tested it with the new 2.x dev version.
The problem changed a little, there is no display issue anymore. When you click on the checkbox, it check and uncheck correctly, but, it doesn't change the state of the field.
EDIT : I made a mistake, in my case, it works when I check the checkbox, but not when I uncheck.
Comment #25
tim.plunkettConfirming behavior of #24.
Works to check the checkbox, but not when unchecking one.
Comment #26
Parkes Design commentedConfirming behavior of #24 & #25
Subscribe
Comment #27
damienmckennaWe're also running into this with 6.13 and the latest everything else.. Hrm..
Comment #28
andyf commentedI have the same problem, subscribing
Comment #29
iancawthorne commentedSubscribing. Same problem. Single checkbox all browsers. Multiple select checkboxes, just Firefox.
Comment #30
markfoodyburton commentedThe ajax serializer returns an empty string for an unchecked check box.
The drupal form's mechanism fills in the old value of a field, if the new one isn't given....
Any ideas?
Cheers
Mark.
Comment #31
markfoodyburton commentedSee also http://drupal.org/node/353110
Comment #32
markfoodyburton commentedAll
I have committed a fix for this -
please try out the latest 2.x version
However, I dislike the code that I've used to fix this - it's a hack.
I'd like to know
a) does it work for you and
b) does it break something else!!!
Please report back (both positive and negative)
Cheers
Mark.
Comment #33
sitron2 commentedtried the 2.x version
it works for a check box when a single node is viewed (i can check AND uncheck.. cool!)
but when used in a view (with 1 check box per node/item) changing any checkbox state will also change the first checkbox!
(if i uncheck the cb in the 3rd row, the cb in the 1st row is also unchecked, same with others rows.. always affecting the selected row AND the 1st row)
Comment #34
markfoodyburton commentedIs #33 a duplicate of http://drupal.org/node/674582?no_cache=1263504687
Can you try out the patch there?
Cheers
Mark.
Comment #35
amygdala commentedsame issues (including #33). subscribing. (ps: thanks for a most simple but much needed module. this should probably be in cck core)
Comment #36
markfoodyburton commentedI believe this is now fixed, can you try the latest 2.x version
Cheers
Mark.
Comment #37
tim.plunkettchecking back in. has the 2.x branch been confirmed to work?
Comment #38
darrellduane commentedI am getting this error for the single on/off checkbox field that I have in my content type. It happens in 6.x-2.0, 6.x-2.x-dev and 6.x-3.x-dev. In checking the database, it seems that when I am checking the check box, it is saving the value '1' in the field, when in fact the value in the database should be the second value in the list of allowed values per the CCK instructions.
Comment #39
ideaguy_ns commentedIn case anyone else has a site that is still using this branch, using the following format in the allowed values worked for me:
0|off
1|On Label
Comment #40
Ramya Nallu commentedi am using single on/off field in drupal7, in views editable , if i check the checkbox it is checked but if i refresh my page checked is removed :( if checked i need that particular row to get highlighted by any color and if unchecked the highlighted color should be removed, is it possible?
Comment #41
dags commentedClosing this as 6.x is no longer supported and it looks like the change in #40 was more of a feature request.