I use Entity Reference View Widget on the form, where some other fields are hidden in hook_form_alter using following way:

$form['field_name'] ['#access'] = FALSE;

Clicking submit button, user sees validation errors, that such fileds are empty. If Entity Reference View Widget is disabled, then no such error happens. I tried to reproduce it with 7.x-1.x-dev, but have other warning messages:

Warning: date_offset_get() expects parameter 1 to be DateTime, null given in date_combo_validate() (line 564 of /var/www/site/sites/all/modules/contrib/date/date_elements.inc).

Steps to reproduce this issue:
* Install and enable Entity Reference View Widget for nodes/entities.
* Add reference field to the node/entity.
* Add the Date field to the node/entity and make it required.
* Alter node/entity form and hide date field using ['#access'] = FALSE;.
* When adding node/entity, select referenced nodes/entities (THIS IS IMPORTANT STEP).
* Click submit button.

See error messages or warnings depending on the version of module is used.

Comments

dealancer’s picture

Ok, looks like the warning is related to my custom code, event if the module is disabled. So recent version of this module may work good.

dealancer’s picture

Status: Active » Closed (works as designed)

Ok, so looks like my problem does not have relation to the recent version of this module. There was a DOM issue in 7.x-1.0-alpha2, but now it is fixed.

dealancer’s picture

Issue summary: View changes

Updated issue summary.