Contextual edit menu for block is missing (6.beta7 to .beta8+)

Created on 9 February 2024, about 1 year ago
Updated 24 February 2024, about 1 year ago

Problem/Motivation

After updating Radix from 6.0.0-beta7 to 6.0.0-beta8 (or 6.0.0-beta9 or current dev as of Feb 9th), the little edit button which appears when you hover a block to edit it is no more appearing (while still being in the code).

This is due to the radix block component twig template being rewritten between the 2 updates (b7 to higher) :

6.0.0-beta7 at line 47:

{% if html_tag %}
  <{{ html_tag }}{{ attributes|without('id').addClass(block_classes) }}>
{% endif %}

6.0.0-beta8 at line 47:

{% if block_html_tag %}
  <{{ block_html_tag }} {{ block_attributes|without('id').addClass(block_classes) }}>
{% endif %}

Mind the "attributes" been rewritten to "block_attributes"

Steps to reproduce

Create a child them using 6.0.0-beta7, all is good.
Same using 6.0.0-beta8 or above, edit button is missing for blocks.

Proposed resolution

As a temporary fix, I copied the all component folder to my child theme and updated the block.twig file so it says :

{% if block_html_tag %}
  <{{ block_html_tag }} {{ attributes|without('id').addClass(block_classes) }}>
{% endif %}

Remaining tasks

I think the radix block component should be fixed (or some dependencies) because if the attribute has been rewritten, there should be some reason behind.

Happy fixing ;-)

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @PhilY
  • πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

    Of course, after copying the component to the child theme, all references to {% include 'radix:block' %} in the 'templates' folder should be updated to {% include 'SUBTHEME:block' %}

    That's why to radix component should be fixed.

  • Hey Philippe, do you still have this issue? I pushed a fix and this should be good on the latest dev

    and not necessarily you don't need to update {% include 'radix:block' %} to {% include 'SUBTHEME:block' %} unless you need to modify it

  • πŸ‡«πŸ‡·France PhilY πŸ‡ͺπŸ‡ΊπŸ‡«πŸ‡· Paris, France

    Yes, the fix from the latest dev release fixes it ;-), thanks.

  • Status changed to Fixed about 1 year ago
  • Great to hear, thanks for your contribution, crediting and closing

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

Production build 0.71.5 2024