Delete/Remove Image button doesn't work
Delete/Remove Image button doesn't work
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
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 (57.21 KiB) Viewed 7354 times
Re: Delete/Remove Image button doesn't work
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!
Re: Delete/Remove Image button doesn't work
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:
Now look for the
'FIELDNAME' => Request::fileUpload('FIELDNAME', [
and add before the
the following:
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 !!
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 = [
'FIELDNAME' => Request::fileUpload('FIELDNAME', [
and add before the
Code: Select all
'success' => function($name, $selected_id) {
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));
}
},
!! NOTE that this file will be overwritten once you recreate you project, so you will need to redo that changes !!
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Delete/Remove Image button doesn't work
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 


Re: Delete/Remove Image button doesn't work
Is there any possibility of an update after every months
tks
tks
Re: Delete/Remove Image button doesn't work
I'm so sorry for the long delay. I've added this issue to our list of fixes for the next release.

- Messages plugin: Make it easy for your app users to communicate securely without leaving the app or having to exchange emails/contact info.
- Calendar plugin: Organize your data into beautiful calendars.
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
- Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

Re: Delete/Remove Image button doesn't work
Hi,
I've tested deleting images in 5.97 due to customer's complaints
but it still seems broken.
Can anyone else confirm this?
I've tested deleting images in 5.97 due to customer's complaints

Can anyone else confirm this?
- Attachments
-
- OcaG9FF9wD.gif (120.27 KiB) Viewed 5795 times
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Delete/Remove Image button doesn't work
Can anyone confirm this issue or does it work for all of you in AppGini 5.97?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Delete/Remove Image button doesn't work
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.
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 />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Delete/Remove Image button doesn't work
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!
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!
Re: Delete/Remove Image button doesn't work
Yes, it is a free working workaound.but this is a workaround
Yes, the fix should be applied to AppGini itself.The fix shoul be done by AppGini
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.It's realy frustrating!
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 />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Delete/Remove Image button doesn't work
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!
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!
Re: Delete/Remove Image button doesn't work
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.
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 />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: Delete/Remove Image button doesn't work
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.
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
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.

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

Re: Delete/Remove Image button doesn't work
Hmm ... I tried reproducing this issue in the demo Northwind app as generated by AppGini 5.97 but wasn't able to
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?

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?

- Messages plugin: Make it easy for your app users to communicate securely without leaving the app or having to exchange emails/contact info.
- Calendar plugin: Organize your data into beautiful calendars.
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
- Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

Re: Delete/Remove Image button doesn't work
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.
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.
Re: Delete/Remove Image button doesn't work
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.
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.
Re: Delete/Remove Image button doesn't work
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.
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.
Re: Delete/Remove Image button doesn't work
Would appear that this fail to "remove image on Save" bug is still present in V5.98?
Created a new test database in V5.98. 1 x table, 3 fields and zero edits.
Result: https://www.loom.com/share/b989ebf2a006 ... 662e7e98b3
And sadly, looks as though Jan's simple fix does not rectify the issue in V5.98.
Will take a look myself when time permits. Still trying to work out what's going on with the dates in V5.98......
Created a new test database in V5.98. 1 x table, 3 fields and zero edits.
Result: https://www.loom.com/share/b989ebf2a006 ... 662e7e98b3
And sadly, looks as though Jan's simple fix does not rectify the issue in V5.98.
Will take a look myself when time permits. Still trying to work out what's going on with the dates in V5.98......
Re: Delete/Remove Image button doesn't work
Sincere apologies Jan - your simple fix DOES work with V5.98. It's my typing that doesn't work. Thanks yet again.
Mind you - I would have hoped/expected this issue to be fixed in the latest V5.98 which looking into the generated file differences, appears to be a major rebuild.
Mind you - I would have hoped/expected this issue to be fixed in the latest V5.98 which looking into the generated file differences, appears to be a major rebuild.
Re: Delete/Remove Image button doesn't work
OK, I'm investigating this issue thoroughly now ... I haven't been able to reproduce it but I'm clearly missing something since many users are reporting it .. So I'll dive deeper into this and make a fix for it. Apologies everybody for that 


- Messages plugin: Make it easy for your app users to communicate securely without leaving the app or having to exchange emails/contact info.
- Calendar plugin: Organize your data into beautiful calendars.
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
- Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

Re: Delete/Remove Image button doesn't work
So, I tested this thoroughly under PHP 7.0, 7.1, ... till 8.1 and it works fine on my side on all versions: https://cdn.bigprof.com/screencasts/app ... -image.mp4
The code for handling file removal can be found in
I'm mentioning all the above details to: 1. Check that code similar to this exists in your generated app, and 2. To trace the execution on your side if you want ... I can check the code if anyone sends me the above mentioned 2 files (Request.php and tablename_dml.php)
The code for handling file removal can be found in
resources/lib/Request.php
in the fileUpload()
method .. specifically lines 79-89. This code is triggered by a call to Request::fileUpload()
that should exist in tablename_update()
function in the generated tablename_dml.php
file (where tablename is the name of the table containing the image upload field)I'm mentioning all the above details to: 1. Check that code similar to this exists in your generated app, and 2. To trace the execution on your side if you want ... I can check the code if anyone sends me the above mentioned 2 files (Request.php and tablename_dml.php)

- Messages plugin: Make it easy for your app users to communicate securely without leaving the app or having to exchange emails/contact info.
- Calendar plugin: Organize your data into beautiful calendars.
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
- Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

Re: Delete/Remove Image button doesn't work
Here you go Ahmed - 2 x files attached.
A simple vanilla 1 x table and 3 x fields app with zero edits. Remove images not working.
---------------------------------------------------------------------------------------
Server architecture Linux 3.10.0-962.3.2.lve1.5.61.el7.x86_64 x86_64
Web server LiteSpeed
PHP version 7.4.25 (Supports 64bit values)
PHP SAPI litespeed
PHP max input variables 3000
PHP time limit 300
PHP memory limit 256M
Max input time 120
Upload max filesize 64M
PHP post max size 64M
cURL version 7.71.0 OpenSSL/1.1.1d
MySQL: 10.3.32-MariaDB
A simple vanilla 1 x table and 3 x fields app with zero edits. Remove images not working.
---------------------------------------------------------------------------------------
Server architecture Linux 3.10.0-962.3.2.lve1.5.61.el7.x86_64 x86_64
Web server LiteSpeed
PHP version 7.4.25 (Supports 64bit values)
PHP SAPI litespeed
PHP max input variables 3000
PHP time limit 300
PHP memory limit 256M
Max input time 120
Upload max filesize 64M
PHP post max size 64M
cURL version 7.71.0 OpenSSL/1.1.1d
MySQL: 10.3.32-MariaDB
- Attachments
-
- Remove-Image-5.98.zip
- (7.25 KiB) Downloaded 47 times
Re: Delete/Remove Image button doesn't work
Thanks for the files. I checked them and Request.php is fine, but the dml file doesn't contain the code for handling file removal request. I tried tracing this and found that in order for the file removal handling code to be included in the dml, the image field should meet 2 conditions:
1. The option "Delete files from server when removed from record" is enabled:
2. The field is not set as "Required" (if the field is required, then you can't empty it by removing the image file without uploading another one)
Now, I realize that the "Remove file" checkbox shouldn't be present if the above 2 conditions are not met as this would confuse users. So, I'll work on fixing this.
1. The option "Delete files from server when removed from record" is enabled:
2. The field is not set as "Required" (if the field is required, then you can't empty it by removing the image file without uploading another one)
Now, I realize that the "Remove file" checkbox shouldn't be present if the above 2 conditions are not met as this would confuse users. So, I'll work on fixing this.

- Messages plugin: Make it easy for your app users to communicate securely without leaving the app or having to exchange emails/contact info.
- Calendar plugin: Organize your data into beautiful calendars.
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Summary Reports plugin: Build powerful reports and charts for your AppGini apps.
- Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.
