isleshocky77 / ninja-forms-mautic

A Wordpress plugin and Ninja Forms add-on which allows you to save form data to Mautic.
GNU General Public License v3.0
9 stars 6 forks source link

Mautic Ninja API #3

Open bobyon opened 6 years ago

bobyon commented 6 years ago

I downloaded and installed the Ninja Forms - Mautic plugin but after configuring the API and completing a form that has a send to Mautic action I get the following error:

Uncaught Error: Class 'Mautic\Auth\ApiAuth' not found in /home/xxxxx/public_html/xxxxx/wp-content/plugins/ninja-forms-mautic-master/includes/Actions/SendToMautic.php:91 Stack trace:

0 /home/xxxxx/public_html/xxxxx/wp-content/plugins/ninja-forms/includes/AJAX/Controllers/Submission.php(359): NF_Mautic_Actions_SendToMautic->process(Array, '1', Array)

1 /home/xxxxx/public_html/xxxxx/wp-content/plugins/ninja-forms/includes/AJAX/Controllers/Submission.php(75): NF_AJAX_Controllers_Submission->process()

2 /home/xxxxx/public_html/xxxxx/wp-includes/class-wp-hook.php(286): NF_AJAX_Controllers_Submission->submit('')

3 /home/xxxxx/public_html/xxxxx/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)

4 /home/xxxxx/public_html/xxxxx/wp-includes/plugin.php(453): WP_Hook->do_action(Array)

5 /home/xxxxx/public_html/xxxxx/wp-admin/admin-ajax.php(99): do_action('wp_ajax_nf_ajax...

Can you help find the resolution?

Thanks, Bob

isleshocky77 commented 6 years ago

@bobyon, I actually never knew it was listed on the mautic add-ons site, so I don't know how it was packaged up. I would make sure it has all of it's dependencies by trying to run composer install from the root of the plug-in directory.

helbertqueiroz commented 6 years ago

Hi. I have this problem too. @bobyon have you sucess to soluction this problem? My return for the site: Fatal error: Uncaught Error: Class 'Mautic\Auth\ApiAuth' not found in /wp-content/plugins/ninja-forms-mautic/includes/Admin/Settings.php:136 Stack trace: #0 /wp-includes/class-wp-hook.php(286): NF_Mautic_Admin_Settings->authorize_setting('1') #1 /wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #2 /wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /wp-content/plugins/ninja-forms/includes/Admin/Menus/Settings.php(199): do_action('ninja_forms_sav...', '1') #4 /wp-includes/class-wp-hook.php(286): NF_Admin_Menus_Settings->update_settings('') #5 /wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6 /wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 /wp-admin/a in /wp-content/plugins/ninja-forms-mautic/includes/Admin/Settings.php on line 136

Can anyone help me with this?

isleshocky77 commented 6 years ago

@helbertqueiroz Same as above, make sure the API library has been included from composer.

helbertqueiroz commented 6 years ago

image Even with composer install I could not make it work

calevans commented 4 years ago

I got it to work but you have to:

calevans commented 4 years ago

I spoke too soon. I can get the authorize cycle to execute but I can't tell if it actually worked. There doesn't seem to be any success notification.

Also, I've updated one of my forms, mapped the fields, but the contact did not appear in my Mautic instance.

:(

Sandy-Garrido commented 4 years ago

I got it to work but you have to:

  • composer install
  • composer require mautic/api-library
  • Edit the main file to add require 'vendor/autoload.php'; somewhere near the top. I added it right after the else.

I can confirm this works, although just to clarify @calevans instructions.

  1. Run composer require mautic/api-library within the plugin root
  2. Add require 'vendor/autoload.php'; to line 18 of ninja-forms-mautic.php

I spoke too soon. I can get the authorize cycle to execute but I can't tell if it actually worked. There doesn't seem to be any success notification.

Also, I've updated one of my forms, mapped the fields, but the contact did not appear in my Mautic instance.

:(

This is a known issue that another use has recommended enhancements for.