Issue #3167408 by pcambra: field_attach_validate not called for some farmOS entities

This commit is contained in:
pcambra 2020-09-16 07:54:41 -04:00 committed by Michael Stenta
parent e093c5863b
commit 82874abdee
2 changed files with 4 additions and 1 deletions

View File

@ -176,6 +176,8 @@ function farm_asset_form(array $form, array &$form_state, FarmAsset $farm_asset)
* The form state array.
*/
function farm_asset_form_validate(array $form, array &$form_state) {
$farm_asset = (object) $form_state['values']['farm_asset'];
field_attach_form_validate('farm_asset', $farm_asset, $form, $form_state);
// If the 'archived_boolean' checkbox has changed, update the asset.
if ($form_state['values']['archived_boolean'] != $form['asset_status']['archived_boolean']['#default_value']) {

View File

@ -173,7 +173,8 @@ function farm_plan_form(array $form, array &$form_state, FarmPlan $farm_plan) {
* The form state array.
*/
function farm_plan_form_validate(array $form, array &$form_state) {
$farm_plan = (object) $form_state['values']['farm_plan'];
field_attach_form_validate('farm_plan', $farm_plan, $form, $form_state);
}
/**