Very interesting use case. Of course, this means you must *completely* trust your user as he could issue a "drop database" statement, or worse.
Does the field save properly if you don't run the query in it in the beforeSave() request?
Undesired fixed value after beforeSave
9 posts
• Page 1 of 1
Re: Undesired fixed value after beforeSaveVery interesting use case. Of course, this means you must *completely* trust your user as he could issue a "drop database" statement, or worse.
Does the field save properly if you don't run the query in it in the beforeSave() request? --
Steve Hannah (on twitter)
Re: Undesired fixed value after beforeSaveIn fact I'm the only one who can create "users", users themselves can't edit their preferences. If they want to add something here, they just ask me. Of course if it wasn't the case it would be waaaay too dangerous.
Yes it saves it and changes it correctly in the database and in the form.
Re: Undesired fixed value after beforeSaveSo, to be clear. Suppose you have query A and query B, where query B is a valid SQL query and A is an invalid SQL query (i.e. would throw an error if run in mysql_query()).
On your form you begin with sql_vco_affaires empty. You enter query A into the sql_vco_affaires field and click save. It gives you an error message on the form and the form is not saved. At this point the form shows query A in the sql_vco_affaires field, but it is highlighed as error input. So you paste query B into the sql_vco_affaires field, and click save. It too comes back with an error. At this point the sql_vco_affaires field still contains query A, and is marked as an error. Is this correct? --
Steve Hannah (on twitter)
Re: Undesired fixed value after beforeSaveExactly.
That's it. And I really don't understand why.
Re: Undesired fixed value after beforeSaveI don't understand why that would be either. You may want to do some debugging to try to get more information about why that query step is screwing things up. It doesn't make sense.
--
Steve Hannah (on twitter)
Re: Undesired fixed value after beforeSaveHow can I try to debugg it ? I don't really know how to do it...
Re: Undesired fixed value after beforeSaveWell, as a starting place you already know that it works if you don't perform the query inside beforeSave(), right? I would put echo statements (followed by exit) into your beforeSave() and afterSave() triggers to see what query is actually being run and whether values are being changed... Just follow the trail with echo statements and something should pop up.
-Steve --
Steve Hannah (on twitter)
Re: Undesired fixed value after beforeSaveI will check this as soon as I can, thank you.
9 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 2 guests |