Problem/Motivation
Managed Files. Non-Null Default values in edit forms sometimes lack resize messages and Remove Buttons. The saved files also feature a status code of zero and therefore deleted by Cron.
1. "PetListBeforeSubmit" attachment, below, shows the list before editing with a blank pet_photo_id.
2. "EditBeforeSubmit" shows the form edit with a selected image without resize messages or remove button.
3. "PetListAfterSubmit" shows the list without the pet_photo_id, no change from before submit.
4. "fileValidateImageResolutionWarning" shows:
"Warning: Trying to access array offset on value of type null in Drupal\pet\Form\PetEditForm->buildForm() (line 201 of
/var/www/html/drupal/modules/custom/pet/src/Form/PetEditForm.php)"
5. "FileMgdEditImageAfterSubmit" shows the file_managed table extract in MariaDB. Note the file code
of zero.
6. "FileAddedAfterSubmit" shows the added file itself ('Octopus2',bottom) which would be deleted by cron.
7. "FormEditPetPhotoId" shows the $form entry. Note the non-Null default value:[$row['pet_photo_id']].
This problem is intermittent. Running under Ubuntu Server, above, features this anomaly. But running
Ubuntu under Windows Linux does not appear to.
8. "HelloEditImageWithNotificatioins". shows an image with resize messages and Remove Button.
9. "FormEditHelloGreetingPic". shows its $form entry. I don't see a substantive difference between it and item 7.,
but I could be wrong.
I'm submitting this entry initially as a support request. If no problem is found I'll resubmit
as a bug.
Many thanks for your attention.
Steps to reproduce
Create a managed file entry like item 7 or 9 above, with and without a non-null default. Note, the non-null default value is an array.
Proposed resolution
An analysis of the error message, item 4, above could provide information
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet