0

I'm working on a Drupal 10 upgrade and have run into a strange problem ... the contextual edit buttons on my site will not hide. They should be hidden until you mouse over a region/block/whatever, but mine are currently all on all the time.

I THINK this might be due to the fact that, for some reason, the Twig debugging comments around them seems to be stuck on (for lack of a better term).

<div data-contextual-id="block:block=nla_owners_theme_page_title:langcode=en" data-contextual-token="BkKyejE0rLQX-QEe31ftM_FGznoaAMuM_XXvgr1tlrE" data-drupal-ajax-container="" data-once="contextual-render" class="contextual">
  <button class="trigger focusable" type="button" aria-pressed="false">Open  configuration options</button>
  <!-- THEME DEBUG -->
  <!-- THEME HOOK: 'links__contextual' -->
  <!-- FILE NAME SUGGESTIONS:
     * links--contextual.html.twig
     x links.html.twig
  -->
  <!-- BEGIN OUTPUT from 'themes/contrib/classy/templates/navigation/links.html.twig' -->
  <ul class="contextual-links" hidden="">
    <li class="block-configure"><a href="/admin/structure/block/manage/nla_owners_theme_page_title?destination=/node/763%3Fcheck_logged_in%3D1">Configure block</a></li>
    <li class="block-remove"><a href="/admin/structure/block/manage/nla_owners_theme_page_title/delete?destination=/node/763%3Fcheck_logged_in%3D1">Remove block</a></li>
  </ul>
  <!-- END OUTPUT from 'themes/contrib/classy/templates/navigation/links.html.twig' -->    
</div>

Also, if I open that links.html.twig template and just completely empty it, nothing changes.

I know to normally disable and enable the twig debugging in services.yml and that works for the rest of the page code in terms of showing/hiding the debug info, but no matter what I do, this one template will not change.

Here is my services.yml file...

parameters:
  session.storage.options:
    gc_probability: 1
    gc_divisor: 100
    gc_maxlifetime: 200000
    cookie_lifetime: 0
  twig.config:
    debug: false
    auto_reload: null
  cache: true:
  renderer.config:
    auto_placeholder_conditions:
      max-age: 0
      contexts: ['session', 'user']
      tags: []
  http.response.debug_cacheability_headers: false
  factory.keyvalue:
    {}
  factory.keyvalue.expirable:
    {}
  filter_protocols:
    - http
    - https
    - ftp
    - news
    - nntp
    - tel
    - telnet
    - mailto
    - irc
    - ssh
    - sftp
    - webcal
    - rtsp
  cors.config:
    enabled: false
    allowedHeaders: []
    allowedMethods: []
    allowedOrigins: ['*']
    exposedHeaders: false
    maxAge: false
    supportsCredentials: false

How can I fix this? I'm almost at a loss for how to even ask this question. Thanks!

2 Answers 2

0

Disable Twig debugging in the admin UI.

2
  • Already done. I actually didn't know that was there until today ... been vim editing my services.yml file. Commented Dec 2, 2023 at 0:43
  • The global settings, whether in admin UI or services.yml, don't answer why it only affects one template. It could be connected to how the contextual module loads the links, which is very different from the rest of the page content.
    – 4uk4
    Commented Dec 2, 2023 at 9:14
0

So, it turns out this was something with Chrome. I still can't explain it ... I set debug on and off multiple times, rebooted the server and computer, etc. and it still happens on my Chrome. But I tried it in a different browser and in Chrome incognito mode and the problem wasn't there. I even tried a hard reload in Chrome.

So, thanks for everyone's input, but at this point I'm moving on and writing this off as some glitch in Chrome. Hopefully, it goes away soon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.