JoomGalleryfriends / JG4-dev

Development repository for JoomGallery v4.x
GNU General Public License v3.0
10 stars 6 forks source link

[Image upload] Image record saved if error during imagetype creation #101

Closed Elfangor93 closed 7 months ago

Elfangor93 commented 1 year ago

Steps to reproduce the issue

  1. Open an empty image form view (add new image)
  2. Fill in the form and shoose an image --> Image should create an error during upload (e.g image >10MB, GD image processor, 128MB php max memory)
  3. Press Save&Close

Expected result

We stay in the view. An error stating that the item can not be saved and the debug output telling the problem.

Actual result

View is closed. We return to the list view. An error appears that the image was not saved. Debug output is shown telling the problem. But still the image record is there, just without images.

Additional comments

Imagetypes (original, detail, thumb) gets created after the image record is successfully stored to the database. https://github.com/JoomGalleryfriends/JG4-dev/blob/94cd098ddab3a6b938a3160b4b7bef8533982e0a/administrator/com_joomgallery/src/Model/ImageModel.php#L492

If an error accured during imagetype creation, all images gets deleted (rollback) and the method is exited (return false).

Elfangor93 commented 7 months ago

Close this issue since PR https://github.com/JoomGalleryfriends/JG4-dev/pull/178 fixed this issue...