• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Calc element throws error

venekamp

Member
Hi,

Currently I am working on a geneology app. In this app I have a list: Persoonsgebeurtenissen in which I collect personal events for my geneaology database. This list uses the table fluve_fam_events. Relevant elements for my problem are Id and datum datum is a textfield representing a year with some additional text (examples “1350 -ca” , “1510 –<” , “1744 >-” )

To add persons to teh event I have the repeating group ‘Persons in events” using table fluve_fam_personenbijgebeurtenis that has a database join on fk_gebeurtenis to fluve_fam_events on Id. In this repeating group I have the element datum in which I copy the value from datum in fluve_fam_events. (So I can use the fluve_fam_personenbijgebeurtenis in views that show the timeline for a person)
To do so I made this second element a calc element using this code (based on what I found in WIKI)
<<
$value = {fluve_fam_personenbijgebeurtenis___fk_gebeurtenis_raw};
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery
->select('datum')
->from('fluve_fam_events')
->where('id = '. $myDb->quote( $value ));
$myDb->setQuery($myQuery);
$myvalue = $myDb->loadResult();
Return $myvalue;
>>
Only Calc on Save option is set to “Yes”. Other options are set to “No”
As I expect when I add persons in the intial registration Datum is blanc in the repeating group when I add a person.
Same when I initially create an event without persons and add persons to the event.
In both cases Datum in the repeating group is a copy from the event after saving the form.

However adding a person to an event that already has populated person-groups: When I add a new person the Datum in the persongroup contains the value from event. Then when saving the event I get an error saying “0 syntax error unexpected token ;”
Changes made is an existing person throws the error “0 syntax error unexpected token ,”

adding &fabrikdebug=1 to the URL does not show debug info.
Note: site is not on Internet but under development

upload_2021-12-14_22-39-38.png


upload_2021-12-14_22-40-3.png


upload_2021-12-14_22-40-26.png
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top