Problem/Motivation

At the moment a rvp field cannot be saved without a value in the entity reference. A constraint of the underlying entity reference field type is triggered and the for submission breaks.

Proposed resolution

At settings for the required property of the form elements for the reference and the value.

Remaining tasks

  • Configuration form for "requried" settings
  • Implementation of "required" settings

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 Selection_1897.png42.21 KBisaacrc

Comments

miiimooo created an issue. See original summary.

sgp913’s picture

This is still an issue as of May 2017.

Could we either validate the form before submission to check that there is a reference value present or:

Would it be possible to treat the empty entity reference field as NULL if there is additional text present?
There seems to be some related work on this here: https://www.drupal.org/node/2834024

For my current case, I am using a custom formatter to override the label of the entity reference with the text, but in the case that there is no entity, I would still like to be able to input text here.

isaacrc’s picture

Status: Active » Needs work
isaacrc’s picture

Assigned: miiimooo » isaacrc

  • isaacrc committed 59c159b9 on 5.0.x
    Issue #2824432: Fix fatal error when submitting value without entity...
isaacrc’s picture

Status: Needs work » Fixed
StatusFileSize
new42.21 KB

Added validation when the EE is empty but the text field has a value. Fixed in this commit: https://git.drupalcode.org/project/reference_value_pair/-/commit/59c159b...

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

isaacrc’s picture

Status: Fixed » Closed (fixed)