Hi,
the table doesn't work correctly in CF 8 when using read data joins?
The table is empty, even though the debugger info shows the correct SQL statement with the correct result. I can also copy the SQL from the debugger and test it directly in PHPMyAdmin.
What is the problem now?
F.
Hi Fred
if the results are shown in the Debug then you need to add the correct data path in the table columns, or the columns contents, can you show a part of the debug results and your table configuration ?
The debugger displays everything correctly. There are no errors. Both column contents should be displayed, but the columns are still empty.
Array
(
[read_beob_art] => Array
(
[sql] => SELECT `Nachweis`.`nachweismethode` AS 'Nachweis.nachweismethode', Count(Main.beof_id) AS 'Main.total' FROM `mtb_beobachtung_art` AS `Main` LEFT JOIN mtb_beobachtung AS `BEOB` ON Main.beof_id=BEOB.beof_id LEFT JOIN mtb_nachweismethode AS `Nachweis` ON Main.nachweis_id=Nachweis.id_nw WHERE BEOB.user_id=909 GROUP BY nachweis_id ORDER BY nachweismethode ASC
[returned] => Array
(
[0] => Array
(
[Nachweis.nachweismethode] => Bäume absuchen
[Main.total] => 4
)
[1] => Array
(
[Nachweis.nachweismethode] => Eisuche
[Main.total] => 1
)
Ok, now I need to check your Table view configuration, can you share a screenshot of that ?
Correct, I think there is a bug
Please find this file:
/joomla/administrator/components/com_chronoforms8/pages/chronoforms/views/table/output.php
And at line 99:
return Chrono::getVal($row, $column["path"], "");
Change it to:
return isset($row[$column["path"]]) ? $row[$column["path"]] : "";
Does this fix the issue for you ?
Hello,
Thank you for your help.My test has shown:When I preview the form in the backend using the "Preview" button, the table is displayed correctly.When I open the form in the backend in the Forms list using the "Front" button, the table is not yet displayed, and the debugger only shows the SQL query in the info field without the array result.
Array
(
[read_beob_art] => Array
(
[sql] => SELECT `Nachweis`.`nachweismethode` AS 'Nachweis.nachweismethode', Count(Main.beof_id) AS 'Main.total' FROM `mtb_beobachtung_art` AS `Main` LEFT JOIN mtb_beobachtung AS `BEOB` ON Main.beof_id=BEOB.beof_id LEFT JOIN mtb_nachweismethode AS `Nachweis` ON Main.nachweis_id=Nachweis.id_nw WHERE BEOB.user_id=0 GROUP BY nachweis_id ORDER BY nachweismethode ASC
[returned] => Array
(
)
)
)
Hi Fred
Great, so the fix is working.
If no results are returned on the frontend then you need to check your database query conditions, your WHERE has user_id=0 now
And why shouldn't it work in "Where" anymore? It used to work in "Front" too, and I didn't change anything.
BEOB.user_id={user:id}
if the query returns 0 rows then the table is empty or the conditions inside WHERE are not returning any results
But it is very strange why the table is displayed in the "Preview" and in the preview with the "Front" button the table is empty.
Hi Fred
But the "Front" link is testing the form on the frontend, where you should be logged in separately from the backend, however, the "Preview" is testing on the backend, using your admin session.
I think we're talking at cross purposes :-)
In both cases, I'm logged in to both the backend and the frontend.
And I want to emphasize again that the debugger previously displayed the correct SQL code in both cases. And the user_id was also not empty! Only after I modified your code is the user_id displayed as empty in the frontend when I click the "Front-Button".
This is still a bug.
But your WHERE statement is showing user_id=0, this would not happen if you were logged in on the frontend.
Please double check your are logged in on the frontend, my code fix should not affect the WHERE statement
Damn...I take it all back...I ended up on the wrong login form...grrr...sorry
No problem!
