Nachtrag: Maybe it’s a more simple solution not to set $validation->valid = true; by default but to false?
Why assume that the form is valid and everything goes well by default and have the “Success” message displayed?
Hello zopocecito and thanks for the inquiry,
the refresh token usually works very well. Only when the token was not saved at all for some reason or got lost it might cause it to not be available at all. Or when during the refreshperiod of 30 days no new token was created automatically.
To reconnect you would usually just need to click on the button and enter your CleverReach access information once again. If this does not solve the connection please consider uninstalling and reinstalling the plugin.
The question if a form creates an error when a recipient is already present depends on the configuration of the form and Plugin. Can you send me more information in which account which form is used, which plugin version is used etc? You can send it via https://support.cleverreach.de/hc
Thanks!
Dennis Welz
Hi Dennis,
thank you for your reply but I think you didn’t understand the problem.
- old version 2.2. was installed, this version was managing “access_token” and such totally different
- Plugin was updated to 2.3.0, “everything” (under the hood) was changed
- as one result connection to Api was lost
- but still the form in the frontend rendered “Success” – no matter the user was already signed up or not – and although nothing actually “happened”, because there was no connection to CleverReach / the api
This I consider as a bug or flaw, because this is bad when you are on “Auto update”.
As I wrote above, I think the reason lies in class-form.php in function process_form().
It sets “$validation->valid” to true by default, and when there is something wrong with the Api connection or when there is no access_token “$validation->valid” remains true … and the form shows “success”.
In line 108 the validation has this statement:
if ( $validation->valid && $this->auth_service->get_access_token() ) {
...
}
$this->auth_service->get_access_token() just reads the access_token from the database – which was not there.
And when $validation->valid is true, but $this->auth_service->get_access_token() is false, then the code in the if-statement is not executed (which is ok), but $validation->valid remains true.
Maybe you can forward this to your developer(s), they might have a better understanding?
Viele Grüße!
-
This reply was modified 11 months ago by
zopocecito.
Hey @zopocecito,
I am indeed not aware of this change of the handling. That seems strange. I will check this behavior with the plugin programmers it and come back to you when i have more details! Thanks a lot for sending me all those details.
Liebe Grüße!
Dennis Welz
Hey @zopocecito,
we found what you where referring to and have added an error message so it does not give a success message anymore when that is not true. We still need to translate it which sometimes takes time to take effect in WordPress Translation project but ist should soon be available.
Thanks for pointing it out!
Dennis Welz
Hey @zopocecito,
the translation is live and the new plugin version 2.3.1 is released on the marketplace – this should fix it. Again thanks a lot for your input – its appreciated!
Best Regards
Dennis Welz
Vielen Dank auch von meiner Seite! 🙂