Hello everybody,
I have an app working fine developed with Appgini Version 5.76. After upgrading to Appgini V5.92, a couple of weeks ago, the systems is not working.
As an example, I have this code in a hook working perfecty fine:
$id_itemsorden=$data['selectedID'];
sql("update itemsorden left join menu on itemsorden.nombre_itemorden = menu.id_menu set itemsorden.precio_itemorden = menu.precio_menu where id_itemsorden ='$id_itemsorden'", $eo);
$pitemorden = sqlValue("SELECT precio_itemorden FROM itemsorden WHERE id_itemsorden = '$id_itemsorden' ");
$total_itemorden=money_format('%.2n',$pitemorden*$data['cant_itemorden']*(1+$data['iva_itemorden']/100));
sql("update itemsorden set total_itemorden='$total_itemorden' where id_itemsorden='$id_itemsorden'", $eo);
updatecfTotals($data['orden_item']);
After upgrading, that code stopped working. Has something changed in the sql sintax to be used in the new Appgini Version?
This is just a piece of code, I have worked a lot on this app in order to achieve what it is needed and it is taking me a lot of time trying to figure out how to replicate all the features of the app using the new calculated field tab in Version5.92, so I would like to keep the hooks approach, until I manage to learn how to do it withing the calculated tab in AppGini.
Thanks in advance for all the help.
sql stop working after updating from V5.76 to V5.92
Re: sql stop working after updating from V5.76 to V5.92
I have had other trouble with v5.9x. I have stayed with v5.84. I would try v5.84 to better isolate where the failure is.
Re: sql stop working after updating from V5.76 to V5.92
Hi,
if you say the code is not working any more? Are you getting errors? What is not working?
I feel the base sql syntax and functions did not change, so there might be another issue.
if you say the code is not working any more? Are you getting errors? What is not working?
I feel the base sql syntax and functions did not change, so there might be another issue.
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: sql stop working after updating from V5.76 to V5.92
Hello and thank you for your help.
To pfrumkin, I have tryed with Appgini V5.84, but did not solve the issue.
To pböttcher, that code is placed in after_insert and after_update in the same hook file.
I some installs, it only works in after_insert and in others, it won´t work in any case (neither in after_insert nor in after_update).
I am trying is in a local environment, I will try in a web server and see what happens.
I will let you know
Thank you both again
To pfrumkin, I have tryed with Appgini V5.84, but did not solve the issue.
To pböttcher, that code is placed in after_insert and after_update in the same hook file.
I some installs, it only works in after_insert and in others, it won´t work in any case (neither in after_insert nor in after_update).
I am trying is in a local environment, I will try in a web server and see what happens.
I will let you know
Thank you both again
- D Oliveira
- AppGini Super Hero
- Posts: 348
- Joined: 2018-03-04 09:30
- Location: David
Re: sql stop working after updating from V5.76 to V5.92
running 5.81 without problems, its seems to me that was the last stable version, I would give it a try, also the formatting of your code is a little different than what I use, for instance, where you wrote:
I would have written:
try re-writing the statements if downgrading the version doesn't work
Code: Select all
WHERE id_itemsorden = '$id_itemsorden'
Code: Select all
WHERE id_itemsorden = '{$id_itemsorden}'
Re: sql stop working after updating from V5.76 to V5.92
I have found the issue: precio_itemorden is a lookup field, so in the past version of Appgini (working fine until now) I got the value from the parent table and updated the field in order to have the value, instead of the primary key. It seems this is not working anymore.
Another thing was that the iva_itemorden has a default value. It worked OK when inserting a new record, however, when editing that record, the default value was deleted, so that is why the script did not work.
Another thing was that the iva_itemorden has a default value. It worked OK when inserting a new record, however, when editing that record, the default value was deleted, so that is why the script did not work.