500 Fabrik has generated an incorrect query for the list

Hello,

I have created a list using the content type way. When I try to display the newly created list, I get an 500 error message:
500 Fabrik has generated an incorrect query for the list Year 2018 Activity: <br /><br /><pre>DateTime::__construct(): Failed to parse time string ({orders___OpDate}) at position 0 ({): Unexpected character</pre>
The form I used to export the content type works perfectly.
My Joomla version is 3.9 and Fabrik is 3.9 too. I have a standard subscription but I can’t access my account. There is just a big ooops. The site having the issue is rocksolid.
Thank you for your intervention.
 
You might want to turn on joomla debug in the Global Configuration System options and also set the Error Reporting to Development in the Server options. Save the changes and then access your list again. You should be able to see where in the code the problem is occurring and what the sql is. These may help you determine the problem.
 
({orders___OpDate}) at position 0 ({): Unexpected character</pre>
It seems there's some placeholder in your date element which is not replaced. Do you have e.g. php validation or a validation condition etc?
 
Yes, I have a notempty validation on this element. I have unpublished it on the new list and I had no change. The new list is on a different table named orders18. The error message displays the element name of the original list.
 
You might want to turn on joomla debug in the Global Configuration System options and also set the Error Reporting to Development in the Server options. Save the changes and then access your list again. You should be able to see where in the code the problem is occurring and what the sql is. These may help you determine the problem.

I did turn on Joomla debug as you advised above, however, no new messages displayed.
 
When I open the content type xml, I can see that it is used on 3 calc elements that I have corrected as follows:
$start = '{orders18___OpDate}';
if (!empty($start)) {
$end = new DateTime($start);
return $end->modify("-10 days")->format("d-m-Y");
}
else {
return "";
}

Now the issue has been solved. Thank you very much for your 10/10 guidance.
 
Yup - when doing the content type creation we can handle all Fabrik internal usage of table names, but anything in custom code with placeholders, you'll have to take care of yourself.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top