Delete/Remove Image button doesn't work

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
federico
Veteran Member
Posts: 66
Joined: 2020-10-29 14:52

Delete/Remove Image button doesn't work

Post by federico » 2020-12-28 15:13

Hi All and Merry Christmas!

On a photo record if I try to delete the picture which I recently upload, it doesn't work. I can just replace the image with another one. Am I wrong?
App Gini version 5.92 1126

tks
Federico
Attachments
Cattura.JPG
Cattura.JPG (57.21 KiB) Viewed 1521 times

dge
Posts: 14
Joined: 2013-12-05 02:54

Re: Delete/Remove Image button doesn't work

Post by dge » 2020-12-29 00:14

Yes, I found the same issue today in 5.92. Remove image (or pdf), save, but it's still there. No way to remove it!

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1281
Joined: 2018-04-01 10:12

Re: Delete/Remove Image button doesn't work

Post by pböttcher » 2020-12-29 12:30

Hi,

it looks like the remove code is not being generated.

What you can try:

Go to the TABLENAME_dml.php file and look for the

TABLENAMEfunction basetable_update(&$selected_id, &$error_message = '') {

You should see a definition of the data array
Something like:

Code: Select all

$data = [ 
Now look for the

'FIELDNAME' => Request::fileUpload('FIELDNAME', [

and add before the

Code: Select all

			'success' => function($name, $selected_id) {
the following:

Code: Select all

			'removeOnRequest' => true,
			'remove' => function($selected_id) {
				// delete old file from server
				$oldFile = existing_value('basetable', 'bild', $selected_id);
				if(!$oldFile) return;
				foreach (["","_tv","_dv"] as $key=>$ext) {
					@unlink(getUploadDir('') . pathinfo($oldFile,PATHINFO_FILENAME).$ext.".".pathinfo($oldFile,PATHINFO_EXTENSION));	
				}
			},
TABLENAME and FIELDNAME need to be adjusted to your needs.

!! NOTE that this file will be overwritten once you recreate you project, so you will need to redo that changes !!

federico
Veteran Member
Posts: 66
Joined: 2020-10-29 14:52

Re: Delete/Remove Image button doesn't work

Post by federico » 2020-12-29 13:13

thanks for your support. This helps for a while. I guess this will be fixed with the next update... I have many of them to fix now, so I'd prefer to wait for an update ;) till my colleagues can wait too :lol:

federico
Veteran Member
Posts: 66
Joined: 2020-10-29 14:52

Re: Delete/Remove Image button doesn't work

Post by federico » 2021-03-16 08:04

Is there any possibility of an update after every months
tks

federico
Veteran Member
Posts: 66
Joined: 2020-10-29 14:52

Re: Delete/Remove Image button doesn't work

Post by federico » 2021-03-19 09:05

federico wrote:
2021-03-16 08:04
Is there any possibility of an update after every months
tks
sorry... 3 months :lol:

User avatar
a.gneady
Site Admin
Posts: 1163
Joined: 2012-09-27 14:46
Contact:

Re: Delete/Remove Image button doesn't work

Post by a.gneady » 2021-05-01 16:16

I'm so sorry for the long delay. I've added this issue to our list of fixes for the next release.
:idea: Calendar plugin: Organize your data into beautiful calendars.
:arrow: Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
:arrow: Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
:arrow: Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

Post Reply