Properly expose config dependencies in block configuration

Created on 8 July 2021, over 3 years ago
Updated 29 May 2023, over 1 year ago

Problem/Motivation

Taxonomy term referenced in "Select taxonomy term(s)" on the block configuration form should also be added as a dependency to the configuration object of that block.

See how happens with content blocks for example: when you create custom content block and place it in the region, configuration object for that block placement have a dependency entry like this:

langcode: en
status: true
dependencies:
  content:
    - 'block_content:basic:79af5eed-a1cb-4da7-aeec-56d650fb196d'
  module:
    - block_class
    - block_content
    - system
  theme:
    - sector_radix_starter
id: backtotop_2

Example above is from Sector configuration block.block.backtotop_2.yml.

Steps to reproduce

- Create a term and a block
- Assign the block to display based on the presence of the term
- Delete the term
- View the block configuration form

Expected behaviour: dependency should prevent deletion of the required term.

Actual behaviour: term can be deleted, and this results in an error 500 when editing the block configuration; block config can no longer be edited via UI.

Proposed resolution

Add term from the configuration to the dependencies.

Remaining tasks

  1. Patch
  2. Review
  3. Commit

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇳🇿New Zealand RoSk0 Wellington

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024