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:

  1. Create a view with fields and set up the fields with one or more links, plus the "Global: Contextual Links" field
  2. Click on "Global: Contextual Links" to open the options form
  3. Uncheck the "Create a label" and click "Apply"
  4. 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).

Comments

happysnowmantech created an issue. See original summary.

happysnowmantech’s picture

Component: Miscellaneous » Code
Status: Active » Needs review
StatusFileSize
new769 bytes
new769 bytes

Patch rolled against 7.x-3.14, see attached.
[ETA: oops, it got attached twice, please ignore the second one.]

krina.addweb’s picture

@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!

krina.addweb’s picture

Status: Needs review » Needs work
alan-ps’s picture

Version: 7.x-3.14 » 7.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new550 bytes

It should help.

krina.addweb’s picture

Status: Needs review » Reviewed & tested by the community

Attached patch is working fine.

nwom’s picture

#5 worked great! Thank you!

kingandy’s picture

Priority: Normal » Major

Patch 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"

guypaddock’s picture

A 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.

hargobind’s picture

#5 works great. RBTC++

ultrabob’s picture

Here's another confirmation that the patch works well, please consider committing!

jacob.embree’s picture

#5 worked for me as well, but applied with fuzz. Here's a reroll.

mustanggb’s picture

nsnoblin’s picture

#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!

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.