Add validation for Views Reference to make sure that has something filled

Created on 6 July 2024, about 1 year ago
Updated 8 July 2024, about 1 year ago

Problem/Motivation

Similar to the issue reported in EPT Views, it is currently possible to create a block without referencing any views. However, if the editor does this, it results in an invalid scenario.

Steps to reproduce

  1. Create an EBT View.
  2. Fill in only the title.
  3. Do not fill in the views reference.

Result: The block is saved without any validation.

Expected: It should validate that there is a reference to a view.

Proposed resolution

Make the reference field required.

Export the config to the /config/install folder. This will work for new sites that install EBT Views.

Create a hook update to set the field as required in the block types for sites that already have the project installed.

This is necessary because the config/sync folder does not apply automatically on update, so a hook_update is required.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.4

Component

Code

Created by

🇧🇷Brazil renatog Campinas

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024