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: 73
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 2336 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: 1308
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: 73
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: 73
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: 73
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: 1171
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.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1152
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Delete/Remove Image button doesn't work

Post by jsetzer » 2021-07-09 06:47

Hi,

I've tested deleting images in 5.97 due to customer's complaints :( but it still seems broken.

Can anyone else confirm this?
Attachments
OcaG9FF9wD.gif
OcaG9FF9wD.gif (120.27 KiB) Viewed 777 times
Kind regards,
<js />

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1152
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Delete/Remove Image button doesn't work

Post by jsetzer » 2021-07-19 06:43

Can anyone confirm this issue or does it work for all of you in AppGini 5.97?
Kind regards,
<js />

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1152
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Delete/Remove Image button doesn't work

Post by jsetzer » 2021-07-19 09:32

If anyone else has this problem: Here is a ("Vanilla"*) hook-only interim workaround:
https://appgini.bizzworxx.de/appgini/so ... gini-5-8x/

That article contains reusable copy & paste code for hooks/__global.php and for hooks/TABLENAME.php. The reusable global code has to be pasted into __global.php once. The table-dependent code has to be pasted into every table-related hook-file which contains image-upload fields.

Hope this is helpful for someone else.

* That code does not need any additional library but works on pure AppGini generated code.
Kind regards,
<js />

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

Re: Delete/Remove Image button doesn't work

Post by federico » 2021-07-26 11:06

Hello Jan

Sorry for the long delay. I still have the problem and I had a look to your work. I'll try to apply it, but this is a workaround. The fix shoul be done by AppGini... I have now to change any table and in the future add this code. It's realy frustrating!

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1152
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Delete/Remove Image button doesn't work

Post by jsetzer » 2021-07-26 12:08

but this is a workaround
Yes, it is a free working workaound.
The fix shoul be done by AppGini
Yes, the fix should be applied to AppGini itself.
It's realy frustrating!
For me, it's important that I can give my clients a solution that works, even if it costs me an hour or two of extra work that I don't get paid for. In the given situation we can keep complaining or we, as a community, can try to improve using hooks-solutions as good as we can and help each other. I am happy about everyone who contributes here in the forum with their help and solid, working solutions.

Just try with the code I have published above. This should solve the problem for the moment and it is only little work for you.

PS: Ahmed (BigProf) has much to do with improving the generated code and with re-designing internals for better future maintainability targeting AG v6.
Kind regards,
<js />

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

Re: Delete/Remove Image button doesn't work

Post by federico » 2021-07-26 17:19

Thank you Jan
Of course your precious time is much appreciated in this forum.
I don't want to criticize but I read many times in other posts that there are many improovments waiting for a real application after a couple of years. AppGini remains a great idea and I guess to see many new features with the version 6

Have a great work!

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1152
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Delete/Remove Image button doesn't work

Post by jsetzer » 2021-07-26 18:08

THIS IS JUST MY PERSONAL OPINION

Well, I think these are two different stories:

Bugs vs Feature Requests

We all have purchased a fixed set of features for a fixed price. Noone has promised to us that, for the same price we have paid once, there will be every new feature someone wishes. No company can promise this. It was our personal decision to buy that tool. We were able to read the docs before and we have decided for the given feature set. It was OUR decision.

BUGS

Real software BUGS, related to the promised features we have paid for, have to be fixed, obviously. And I agree, sometimes I'd like to get the patches faster. But that's life. We know it from big companies, too. Fortunately this specific software AppGini provides so many hook functions and many guys in this community are giving a lot, not only taking. This means we CAN solve problems by ourselves and don't have to wait for Microsoft or SAP.

IMPROVEMENTS

Whereas improvements most of the time are just feature requests (wishes) of one or more users. Sometimes it reads very demanding and sometimes I wonder if those, who start getting angry, have realized at all that they have explicitly decided for a GIVEN feature set at a certain, fixed price in the past. Imagine you buy a Volkswagen car and then every year you demand all the new features of a brand new Tesla or Porsche and ask Volkswagen to deliver a new car for free every year having all new features. No company can fulfill that. When buying a car, it's clear: we get a certain feature set at a certain price. Somehow, when buying a software there seem to be different rules/expectations and a few still think they can get more and more without paying for. A few even seem to think development will get faster the louder they shout, or the more unpolite forum articles they post, all having the same, demanding subject.

I'm happy Ahmed keeps the lane and improves the software wisely. I'm glad not every feature request finds it's way into a follow up release, because in long term this would make AG more expensive and some feature requests are not helpful for most of us but only to very few.

My personal wish: fixing a real bug should have high priority. And if there is an announcement, a certain bug will be fixed with next release, it should be fixed with the next release. This would make it planable. And I can give a perspective to my customers. They can live with a bug if they know it will be fixed with next release. And if there is a workaround, they are happy immediately.

THIS WAS JUST MY PERSONAL OPINION. Everyone is free to read it or skip it and/or to write her/his own.

Keep going, Ahmed, I'm pretty sure there are many many silent readers who are following you and your decisions and are happy with such a smart tool saving months of working time per project.
Kind regards,
<js />

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

Re: Delete/Remove Image button doesn't work

Post by federico » 2021-07-27 06:39

Jan
Totaly agree with you. New features could be done or not, paied or not... decision of the software house.

However I created this post as a bug at the end of last year with 5.92 1126 and after 5 releases it has not been fixed yet. thank you again for your time, really but, it's just my personal opinion of a user which bought a car with a window that remains open and the meccanic suggests me to hold it with my hand to liftup everytime I open it. :lol:

Anyway when you, Ahmad and someone else will make a fusion of your software house I'm quite sure you'll get more and more success together :!:

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

Re: Delete/Remove Image button doesn't work

Post by a.gneady » 2021-07-28 17:47

Hmm ... I tried reproducing this issue in the demo Northwind app as generated by AppGini 5.97 but wasn't able to :roll:

Here is a short recording showing an image successfully being removed: https://screencast-o-matic.com/watch/criub5Vid9n
Am I missing something? Is it possible to send me a sample AXP project where this is not working?
: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.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 268
Joined: 2013-03-21 04:37

Re: Delete/Remove Image button doesn't work

Post by peebee » 2021-07-29 01:14

Hmmm? Updated to Appgini 5.97 Revision 1142 and I too can confirm that I am experiencing the same issue of images not being deleted on Save? Hadn't noticed until I read this thread.

Multiple image upload fields in multiple tables and none are deleting. Absolute standard image upload fields that I've created many times.

Generated another simple app - same result.

And yes, I can confirm that Jan's very simple and elegant hooks code does solve the problem. Much appreciated and thanks Jan.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 268
Joined: 2013-03-21 04:37

Re: Delete/Remove Image button doesn't work

Post by peebee » 2021-07-29 01:47

Ahmad, for testing purposes, please find the link below to a simple test app and AXP file

It contains one table with two fields (id and image). Zero edits.

I've tested it on a remote web server. It works other than uploaded images are failing to delete on Save.

I've included the AXP file and all Appgini generated files in the zip

https://drive.google.com/file/d/1o9rOnk ... sp=sharing

Thanks for your follow up.

PS: Hope the Drive link works OK? I tried to upload as an attachment but file was too large.

balfons
Veteran Member
Posts: 71
Joined: 2018-10-22 15:27

Re: Delete/Remove Image button doesn't work

Post by balfons » 2021-08-27 08:42

Good morning,

I found this post when trying to solve a problem deleting uploaded files. I'm also using Appgini version 5.97 revision 1142. I tried the workaround suggested by Jan (https://appgini.bizzworxx.de/appgini/so ... gini-5-8x/) just in one table (the most important) and it works right.

Thanks Jan and all contributors to the post, I'll also wait for the bug fixing in next AppGini version.

Post Reply