Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ifame

    (@ifame)

    The same here. We got another Fatal Error with the Event Ticket latest vesion 5.6.0 and had to just rollback to the previous version. Please test

    Theme used: Avada 7.10.0

    WordPress 6.2.2

    Fatal error: Uncaught TEC\Common\lucatume\DI52\NotFoundException: nothing is bound to the ‘tickets.attendee_registration’ id and it’s not an existing or instantiable class. in /usr/home/smgadm/public_html/marianuniversity.edu/wp-content/plugins/event-tickets/common/vendor/vendor-prefixed/lucatume/di52/src/Builders/ClassBuilder.php:84 Stack trace: #0 /usr/home/smgadm/public_html/marianuniversity.edu/wp-content/plugins/event-tickets/common/vendor/vendor-prefixed/lucatume/di52/src/Builders/Resolver.php(233): TEC\Common\lucatume\DI52\Builders\ClassBuilder->__construct() #1 /usr/home/smgadm/public_html/marianuniversity.edu/wp-content/plugins/event-tickets/common/vendor/vendor-prefixed/lucatume/di52/src/Builders/Resolver.php(210): TEC\Common\lucatume\DI52\Builders\Resolver->resolveUnbound() #2 /usr/home/smgadm/public_html/marianuniversity.edu/wp-content/plugins/event-tickets/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(216): TEC\Common\lucatume\DI52\Builders\Resolver->resolve() #3 /usr/home/smgadm/public_html/m in /usr/home/smgadm/public_html/marianuniversity.edu/wp-content/plugins/event-tickets/common/vendor/vendor-prefixed/lucatume/di52/src/Builders/ClassBuilder.php on line 84

    There has been a critical error on this website.

    • This reply was modified 1 year, 10 months ago by ifame.
    ifame

    (@ifame)

    Hi zaus,
    I have a similar issue as this one. When my 3rd party return an error response, I need to be able to skip sending email and stop the redirection to the thank-you page. My implementation is below but it’s not working. Could you please review and let me know if you see anything wrong with it. Thanks!

    My response has a json string in the body and an 400 error code in the response as following:

    [body] => {“status”:”error”, “response”:{“error message”,”error.header”:”There was a problem. Please check the errors below:”}}
    [response] => Array
    (
    [code] => 400
    [message] => Bad Request
    )
    I tried your suggestion of the filter and action as below but neither one works, could you take a look and see if I may have done something incorrectly:
    ---Using filter to process the error status from the body ---
    class MyPlugin {
    public function MyPlugin() {
    add_filter('Forms3rdPartyIntegration_service', array(&$this, 'adjust_response'), 10, 2);
    }
    public function adjust_response($body, $refs) {
    $response_array = json_decode($body);
    try{
    if( false !== strpos($response_array->status, 'error') ) :
    {$refs['message'] = 'Error message';
    add_filter('wpcf7_before_send_mail', 'wpcf7_custom_form_action_url');}
    else:
    $refs['message'] = 'Success message';
    endif;
    } catch(Exception $ex){
    $refs['errors'] = array($ex->getMessage());
    }
    }
    }
    new MyPlugin();

    ---Using action to process response code from the response ---
    function service1_action_callback($response, $results){
    try {
    if( false !== strpos($response['code'], '400') ) {
    $results['message'] = 'Error message';
    add_filter('wpcf7_before_send_mail', 'wpcf7_custom_form_action_url');
    } else {
    $results['message'] = 'Success message';
    }
    } catch(Exception $ex){
    $results['errors'] = array($ex->getMessage());
    }
    }
    add_action('Forms3rdPartyIntegration_service_a0', array(&$this, 'service1_action_callback'), 10, 2);

    --- for skipping email, I tried to implement the following, but it did not seem to work either - please take a look to see if you see anything wrong with it.

    The filter to skip email is added to your function after processing the error response:
    add_filter('wpcf7_before_send_mail', 'wpcf7_custom_form_action_url');
    The function for this filter is:
    function wpcf7_custom_form_action_url( $form) { $submission = WPCF7_Submission::get_instance();
    $submission->skip_mail = true;
    }

    In contact form 7 submission.php, I changed the $skip-mail to public:
    public $skip_mail = false;

Viewing 2 replies - 1 through 2 (of 2 total)