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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

woprrr created an issue. See original summary.

woprrr’s picture

Status: Active » Needs review
FileSize
961 bytes

This fixe the problem.

woprrr’s picture

Status: Needs review » Reviewed & tested by the community

  • woprrr committed 5eb1c37 on 8.x-2.x
    Issue #2867318 by woprrr: File entity integration always File not found
    
woprrr’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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