Problem/Motivation

It seems that some of the farmOs entities are not calling the entity form validation workflow, so stuff such as hook_field_attach_validate() is not run for farm_assets and probably plans and logs

Steps to reproduce

The simplest way is to add the https://www.drupal.org/project/field_validation module, install it (and the field validation ui) and create a validation rule for any field in these entities.

Proposed resolution

Add the logic to validate the relevant entities, as we're wrapping up the entity form, it might need some logic to extract the entity out.

CommentFileSizeAuthor
#4 3167408-4.patch1.32 KBpcambra
#3 3167408-3.patch2.2 KBpcambra
#2 3167408-2.patch1.14 KBpcambra

Comments

pcambra created an issue. See original summary.

pcambra’s picture

Status: Active » Needs review
StatusFileSize
new1.14 KB

Here's an option on how to solve this, posted only for assets for now.

pcambra’s picture

StatusFileSize
new2.2 KB

This one has the farm_plan fix as well

pcambra’s picture

StatusFileSize
new1.32 KB

D'oh I was looking at this wrong yesterday, it is much much simpler...

  • m.stenta committed 82874ab on 7.x-1.x authored by pcambra
    Issue #3167408 by pcambra: field_attach_validate not called for some...
m.stenta’s picture

Status: Needs review » Fixed

Committed - thanks @pcambra!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.