• 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.

End of form submission (onAfterProcess) - only working if form editing

lawmaina78

New Member
Form plugin event "End of form submission (onAfterProcess)" not working for new form, only works when editing an existing form, even though I have set it to work on both.
 
It's working on my site on edit and on new.
When you say not working, is it just not running or does something bad happen?
Error messages? (enable a Joomla error reporting level).
Which exact Fabrik, Joomla, php version?
Anything in your code related to new/existing records (e.g. trying to use non-existing data on new)? Try to debug.
 
For the record the Form php plugin with code running at "end of Form Submission (onAfterProcess)" is working OK in my testing.
Further, the Form PHP code is also called when copying a list row (copy list row plugin), but, for me, I find one change in behavior over Fabrik3.10 when doing a row copy, as described below, in case it helps others.

When my onAfterProcess php script is called from a form add or edit, then for a dropdown element, the object returned from $formModel->getElementData("fullfieldname", true) is an array, as expected. But when the script is called from a list row copy, the same function call returns a straight object. (In 3.10 it also returned an array)
The obvious simple workaround I have added is to check for an array in the returned object in the php code;

$user = $formModel->getElementData("fullfieldname", true);
$userField = is_array($user) ? $user[0] : $user;​

(Fabrik 4.0beta4b, Joomla 4.2.6, PHP8.1)
 
It's working on my site on edit and on new.
Error messages? (enable a Joomla error reporting level).
Which exact Fabrik, Joomla, php version?
Anything in your code related to new/existing records (e.g. trying to use non-existing data on new)? Try to debug.

I've enabled debug mode and seen this error "Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /home1/ugwebcorp/public_html/ecitizen/libraries/fabrik/fabrik/Helpers/Uploader.php on line 217"

I am using

PHP Version 8.1.14
Joomla 4.2.6
 
"Deprecated..." is only a notice.
When you say not working, is it just not running or does something bad happen?
Anything in your code related to new/existing records (e.g. trying to use non-existing data on new)? Try to debug.
Debug = put stuff like var_dump($some-variable);exit; into your code to see where it's (not) going, what you exactly get etc. ("Passing null..." sounds like an empty/not set variable)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top