Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
975 views
in Plugins by
http://docs.question2answer.org/plugins/modules-event/

I am catching the event u_save and check the posted data.

If there is a wrong value, I want to show an error front end, but I could not find out yet, where to define the error. Seems that I cannot use: $event, $userid, $handle, $cookieid, $params
Q2A version: 1.8.0

1 Answer

0 votes
by
selected by
 
Best answer

That's because the event module is just a listener of something that happened. It can't get in the middle of the core's processing. For that to happen, you should use a filter module. Most precisely, implementing the filter_profile() function.

by
Try in a different method. Most likely, your theme or another layer is overriding that method and not calling the parent
by
I have already tried yesterday: initialize(), header(), head(), doctype() - it does definitely not work. The dump always shows NULL. – Same goes for the other form fields, I tried to get "email" for instance, it dumps NULL.

I also tried on the production server, just to be sure it's not a problem with localhost.
I removed all other plugins, same.
by
Got it. Not your problem, definitely. After taking a look at the account page, I noticed there is a REDIRECT for the 'profile-saved' that turns the POST into a GET and loses the request body with the POST params.

You need to take action before the redirect. What about using the filter_profile and access the POST elements from there?
by
With the filter_profile() I may access the POST but I cannot create the error message. That's why we need the layer. – The entire thing seems complicated now :)
...