Problem:
In views with a "Global: Contextual Links" field, the value of the "Create a label" option is not saved if it is unchecked.
Steps to reproduce:
- Create a view with fields and set up the fields with one or more links, plus the "Global: Contextual Links" field
- Click on "Global: Contextual Links" to open the options form
- Uncheck the "Create a label" and click "Apply"
- Click on "Global: Contextual Links" to open the options form again. The "Create a label" option is still checked. Also, if you save this view and then view it, you will see the "Contextual Links:" field label displayed in your view.
Proposed resolution:
views_handler_field_contextual_links.inc has the parent class views_handler_field_links.inc. The options_submit() method in the parent class is missing the logic to save the form state values for "Create a label" option, so the logic needs to be added back in (see options_submit() in views_handler_field.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | views-global_contextual_links_create_label_not_saved-2778747-12.patch | 557 bytes | jacob.embree |
| #5 | views-global_contextual_links_create_label_not_saved-2778747-5.patch | 550 bytes | alan-ps |
Comments
Comment #2
happysnowmantech commentedPatch rolled against 7.x-3.14, see attached.
[ETA: oops, it got attached twice, please ignore the second one.]
Comment #3
krina.addweb commented@happysnowmantech: Thanks for the patch, although this patch runs successfully but while reproducing the steps - it seems to be not working.
Here's the scenario I am generating:
If I uncheck "Create a label" for first time and click on apply, it works fine. But again when we click on "Contextual Links:" and when option form appears the checked field is unchecked.
This means that the last performed activity is not saved.
So, I think we need to apply another patch to work out this results.
Thanks!
Comment #4
krina.addweb commentedComment #5
alan-ps commentedIt should help.
Comment #6
krina.addweb commentedAttached patch is working fine.
Comment #7
nwom commented#5 worked great! Thank you!
Comment #8
kingandyPatch works fine for me and seems pretty essential to basic operation in this area ... Can we get it rolled into a release or at least dev?
Marking as "Major" because "Render one feature unusable with no workaround"
Comment #9
guypaddock commentedA workaround I've noted (without the patch) is that you can empty out the label text field and save, and now suddenly the checkbox will be unchecked.
Comment #10
hargobind#5 works great. RBTC++
Comment #11
ultrabob commentedHere's another confirmation that the patch works well, please consider committing!
Comment #12
jacob.embree commented#5 worked for me as well, but applied with fuzz. Here's a reroll.
Comment #13
mustanggb commentedComment #14
nsnoblin commented#9 - @GuyPaddock, you're a genius (or I'm an idiot ...). My usual fix has been to hide the label with CSS - it never occurred to me to simply empty the label text field. Thanks!
Comment #16
damienmckennaCommitted. Thanks!