0

We hired someone else to make our theme, and they gave us something with the quickedit not working. What can cause this to break, and how do I fix it?

Here's what my contextual-links ul looks like right now:

<ul class="contextual-links" hidden=""><li class="quickedit"><a href="" role="button" aria-pressed="false">Quick edit</a></li><li class="entitynodeedit-form"></li><li class="entitynodedelete-form"></li></ul>

The entitynodeedit-form li is empty, as well as the delete li. What is supposed to fill them in, and how do I fix it?

1
  • 1
    Look in PHP error logs or watchdog (and JavaScript console errors if any) and post them if you still don't have an answer. I found that usually the modal or something javascript-y isn't working because of some PHP error in some contrib (or core) module making some assumption and throwing an exception or fatal error'ing. Commented Nov 8, 2016 at 22:20

1 Answer 1

1

If there is not an obvious error in php or javascript, see the comment from @mradcliffe, then there are probably some attributes missing, because they were removed in twig templates.

The quickedit links are not delivered in html, they are build in javascript. For this the attributes to identify the involved entities and fields need to be present.

Look especially for the attributes data-quickedit-entity-id in node templates and data-quickedit-field-id in field templates.

This is the correct way to add attributes in twig:

{% set classes = [ 'red', 'green', ] %} <div{{ attributes.addClass(classes) }}></div> 

Source: https://www.drupal.org/docs/8/theming-drupal-8/using-attributes-in-templates

1
  • Thanks much, as it turned out the theme had explicitly overridden a links.html.twig template from Classy, and there was an if condition in it that was preventing them from ever showing. Commented Nov 21, 2016 at 19:34

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.