Hi all, i am building a form for a swimming association.
The idea is to use Goodnews (thankyou @gadgetto) to annually send emails to old members to renew their subscription with the necessary documents.
Two documents need to be uploaded, identified, and stored to user profile. (photo + another pdf file)
I am trying to implement this with AjaxUpload (thankyou @jako).
here are the simplified calls:
[[!GoodNewsUpdateProfile?
&validate= email:email:required, gdprcheck:required
&groupsOnly=1
&postHooks=AjaxUpload2Formit,Formit2AjaxUpload
&ajaxuploadUid=photo
&ajaxuploadTarget=components/mxnsubscribed/images/user/
&gdprcheck.vTextRequired=You need to agree to our Terms and Conditions and Privacy Policy.
]]
and if i use the second Ajaxupload :
[[!AjaxUpload?
&uid=certmed
&maxFiles=1
&acceptedFileTypes=image/jpeg,image/gif,image/png,image/webp
]]
Can upload two files, with two AjaxUpload calls, these are uploaded to the temp location, successfully transferred to the storing location and the temp ones are deleted.
Unfortunately, the photo field is updated with an array value.
i added two lines to write to modx log in AjaxUpload2FormitHook.php to try to see what is happening.
I’m currently trying to AjaxUpload2Formit into Goodnews preHooks, (which is were i would think it ought to be).
At the moment i’m getting error :
Uncaught Error: Call to a member function loadMultiple() on null in …core\components\goodnews\src\Controllers\Subscription\UpdateProfile.php:282
I’m not really familiar with GoodNews (and its code base), but it looks like there is a bug in the code and $this->preHooks never gets set before it is used on line 282.
Hi halftrainedharry, thanks for your answer and your amazing help on this forum. And your videos.
Bravo, It worked a treat. Thank you very much.
I have the setup working now, i’ll publish my findings tomorrow after having clead up a little