Missing access operation parameter causes incompatibility with scheduled transitions (and possibly other modules)

Created on 22 February 2023, almost 2 years ago
Updated 30 March 2023, over 1 year ago

Problem/Motivation

When using this module and Layout paragraphs with a content type that uses the Scheduled Transitions module, the toggle publish button does nothing and causes a PHP error

Type php
Date Wednesday, February 22, 2023 - 15:11
User xbMdldSf2Knd
Location {domain}/layout-paragraphs-toggle-publish/61f04d152fa992ec9dd92f62488dddc7/toggle-publish/defb3843-e917-4c02-b475-4d5efee9448c?_wrapper_format=drupal_ajax
Referrer {domain}/node/3001651/edit
Message TypeError: Drupal\scheduled_transitions\ScheduledTransitionsEntityHooks::entityAccess(): Argument #2 ($operation) must be of type string, null given, called in /Users/Andy/Sites/bhcclocalgov/docroot/modules/contrib/scheduled_transitions/scheduled_transitions.module on line 26 in Drupal\scheduled_transitions\ScheduledTransitionsEntityHooks->entityAccess() (line 118 of /Users/Andy/Sites/bhcclocalgov/docroot/modules/contrib/scheduled_transitions/src/ScheduledTransitionsEntityHooks.php)

Steps to reproduce

1. Install this module, layout paragraphs and scheduled transitions
2. Create a content type that uses layout paragraphs and scheduled transitions
3. Try to use this module to toggle paragraphs published state

Proposed resolution

It looks like other calls to _layout_paragraphs_builder_access in *.routing.yml add an additional parameter under defaults with the operation (create / update). I propose doing the same and using update.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom andybroomfield

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

Comments & Activities

Production build 0.71.5 2024