Problem/Motivation
During refactor in Update examples module we have change code of buildCropToForm() to support FormApi usage. But during this refactor we have break the FileEntity support by the way. When we save any content using FileEntity we have this message "No File element found".
Proposed resolution
Fixe this part of code responsible to problems.
// Add check before if element has file form element.
if (!$form_state->hasFileElement()) {
drupal_set_message(t('No File element found.'), 'error');
return;
}
When we use FileEntity we not have any #file element in form_state but we have #image_crop element that contain a property #file to check if element have a file attached. We just need to delete this unused check because we have another check after to retreive directly the File object by getEntity() method.
Comment | File | Size | Author |
---|---|---|---|
#2 | file_entity_integration-2867318-2.patch | 961 bytes | woprrr |
|
Comments
Comment #2
woprrr CreditAttribution: woprrr as a volunteer and at NeoLynk commentedThis fixe the problem.
Comment #3
woprrr CreditAttribution: woprrr as a volunteer and at NeoLynk commentedComment #5
woprrr CreditAttribution: woprrr as a volunteer and at NeoLynk commented