Fixed More detailed error message

lori19

Active Member
Hi all!

Not a big thing, but maybe it's easy to address: I just got the following error message when saving:

An error has occurred with a eval'd field - please inform the web-site owner. Debug: Caught exception on eval in validation condition : Since joomla/database 2.2.0: The parameter $new is deprecated and will be removed in 4.0, use Joomla\Database\DatabaseDriver::createQuery() instead.

Unfortunately, it does not say which element has an error in its validation. So, I had to go through all my elements that have a validation to find the right one. Would it be possible to add this information?

Kindly,
Lorenz
 
components\com_fabrik\models\validation_rule.php line 156

FabrikWorker::logEval($res, 'Caught exception in elementID ' . $this->elementModel->element->id . ' on eval in ' . $this->pluginName . ' validation condition : %s');
 
That may or may not point to the offending code. Prior to calling your eval code, Fabrik clears all previous errors/warnings, so for the most part a warning here would be in your code. However, I have seen cases where this was not so, depending on what you wee doing in your code. You may be making a completely unrelated function call that generated the error.

Just desk check your own code well and it if looks OK ignore these warnings. And of course turning off debug and setting your error level to simple or none will eliminate them.
 
I didn't change anything on the error message workflow, only added the elementID and validation type to the existing message string.
 
Thanks! I usually try to eliminate those deprecated messages as I encounter them. Somewhere down the line they could become"real" errors. If I remove them now, I don't have to do tit later. Here it was a getQuery instead of an createQuery

Kindly,
Lorenz
 
I have seen this type of error too:
It looks like it cannot really be fixed at the moment.
I (or rather ChatGPT :)) created a workaround by storing a prepared statement in the database and bypassing the Joomla database driver, but that's hardly worth the effort.
 
We could always add a version_compare test on the J! version and call the appropriate one. We had to do this with the database drive for a while and now with the getUser function.
 
Back
Top