Add validation to "Add abr configuration" form

Created on 14 March 2023, over 1 year ago

Problem/Motivation

I'm not sure if this should be considered a bug or a feature request. I've selected bug since the the form currently allows you to do things that you might not expect, but feel free to change.

When adding/editing an abr configuration there is no validation other than mandatory fields. As a result it is possible to select invalid fields for the selected reference type.

The following validations should be applied:

  • For User referenced the Field should be an entity reference of type user.
  • For User's email the Field should be of type email.
  • For Profile value the Field can be of any type, but should match the type of the Extra field.
  • For Inherit from parent the Field should be an entity reference of type node.

For all reference types, the "Assign rights" checkboxes, but at least one should be selected or the configuration will be a bit pointless.

Steps to reproduce

Add an abr configuration, selecting invalid field for reference type. For example, if you select User referenced, and pick a node reference field, this could have unexpected results if you reference a node that happened to have the same numeric node ID value as a user ID.

Proposed resolution

Implement validate function for AbrconfigForm to check field types on submit.

Remaining tasks

I am interested in working on the fix for this.

User interface changes

Error message will be displayed if form submitted with invalid field type.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇮🇪Ireland lostcarpark

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

Comments & Activities

Production build 0.71.5 2024