Okay, I’m now using the Form Action API code snippet (here: https://torro-forms.com/api/extending/form-actions/) which extends the Torro_Form_Action class. I’m a little out of my depth here, can anyone explain why I get:
Fatal error: Call to protected Torro_Form_Action::__construct() from context ‘Torro_Manager’ in /Applications/MAMP/htdocs/sandbox/wp-content/plugins/torro-forms/core/managers/class-manager.php on line 66
Hi,
if you want to use MyCred, the eaysiest way to do that is to use the shortcodes of MyCred.
Just put somethong like
[mycred_give amount=”10″ log=”He answered the Form” ref=”bonus_points”]
to Redirections > Textmessage in the form. I think thats the easiest way to implement it. We don’t have an extra plugin for that yet. But we are thinking about to create an extension for that.
I will check the error and have already added an issue for that on Github:
https://github.com/awsmug/torro-forms/issues/330
This problem will be solved the next days in the develope version and will come with 1.0.0 beta 8.
Thank you for reporting! 🙂
Greetings,
Sven
Thanks for your response, Sven. On further investigation of the working form actions inside the plugin I found that I could get mine working by including a couple of extra functions, namely:
private static $instance = null;
and
public static function instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
With the hooked action in place I’ve managed to add a tab in the admin which let’s the user allocate points to a form and then runs the mycred_add function on submission. I spotted a couple of other typos in the example in your docs too: a missing semi-colon on line 33 and the last line tries to register the main class instead of the new one, torro()->actions()->register( 'Torro_Form_Action' ); should be torro()->actions()->register( 'My_Action' );.
Great plugin. This has so far proved the perfect solution to my client’s requirement for a survey builder.
Thanks again
That makes me happy! 🙂
And thank you for your investigation. I will check and fix this today.
If you want to support us, I would be very grateful if you would rate the plugin!
Greetings,
Sven
Hi,
I have fixed the problem, so that you do not need your $instance variable and function anymore. The cunstructor had to be public. I have changed this for the upcoming version 1.0.0 beta 8.
https://github.com/awsmug/torro-forms/issues/330
You can get it, if you download the develop version from Github.
https://github.com/awsmug/torro-forms/tree/develop
Also I have fixed my errors in the documentation.
Greetings,
Sven
-
This reply was modified 9 years, 6 months ago by
Sven Wagener.