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,
I've created a toggle field and configure it to be clickable (on display mode).
When I'm viewing a node, if the field value is set to ON and I toggle it, the value changes to OFF and it's saved properly. However, if the value is set to OFF and I toggle it, the new field value (ON) it is not saved...
Does somebody have the same problem?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#4 | itoggle.clickable.patch | 579 bytes | bkat |
Comments
Comment #2
dromansab CreditAttribution: dromansab commentedNobody can reproduce this issue?
Comment #3
goekhanc CreditAttribution: goekhanc commentedI have the same problem. I would appreciate some hints how this can be solved.
Comment #4
bkat CreditAttribution: bkat commentedI just installed iToggle and immediately hit this. The fix is remarkably simple. In itoggle.pages.inc its changing the field value by setting
entity->{$field}[$lang][$delta] = $value;
which works fine for things fields like promote, status, and sticky but for non-property fields that we add to entities we need
entity->{$field}[$lang][$delta]['value'] = $value;
So I modified it to do
Please review the patch and hopefully commit it or a derivative in.
Comment #5
robertgarrigos CreditAttribution: robertgarrigos commentedI had this same problem. Applying the patch fixed it, although I had to specify the file to patch.
Comment #6
abhishek.pareek CreditAttribution: abhishek.pareek at Innoraft commentedPatch at #4 fixed the problem. Thanks !
Comment #7
abhishek.pareek CreditAttribution: abhishek.pareek at Innoraft commentedComment #8
W.M. CreditAttribution: W.M. commentedPatch at #4 solves the problem. Please commit :-)
Comment #10
alexweber CreditAttribution: alexweber commentedThanks for the contribution! Much-needed new release coming in a few hours...
Comment #11
alexweber CreditAttribution: alexweber commentedFixed in 2.8