Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The form submit: eck__entity__form_submit checks that the property value is not empty. This checks does not pass values like "0" which may be valid. (For example: title, status, a counter...)
//If we find a value set for a property lets just set it
foreach($properties as $property => $info){
$form_value = _eck_form_property_value($state, $property);
if(isset($form_value) && !empty($form_value)){
A simple way to test it is to create a new eck entity (add form) and try to save the Title field as "0": Entity is saved without title (check the edit form).
Attaching a patch removing the !empty() expression.
Comment | File | Size | Author |
---|---|---|---|
eck-2.x-entity-properties-could-be-empty.patch | 629 bytes | GeduR | |
Comments
Comment #1
GeduR CreditAttribution: GeduR commentedComment #2
GeduR CreditAttribution: GeduR commentedComment #3
michaellander CreditAttribution: michaellander commentedWorked for me. I can't imagine there being an issue with this unless someone adding a pre_set behavior is assuming the value won't be null, which I can't imagine a situation where that's the case.
Comment #4
michaellander CreditAttribution: michaellander commentedComment #7
fmizzell CreditAttribution: fmizzell commented