Skip to content

Commit

Permalink
release: v.2.3.4
Browse files Browse the repository at this point in the history
- Fix z-index with Shape Divider in Section
- Fix Tabs Block Resetting Editor Sidebar When Changing Viewport
- Fix Fatal Error in Form Submission Page in Certain Cases If Viewed as Super Admin
- Fix Progress Bar Height for Mobile Devices
- Fix Stripe Block Not Working Correctly in WP 5.9
- Fix Form Submit Messages Not Working
  • Loading branch information
HardeepAsrani authored Aug 23, 2023
2 parents 7fcc6d0 + 0adae93 commit 9318a8b
Show file tree
Hide file tree
Showing 39 changed files with 1,656 additions and 1,014 deletions.
52 changes: 25 additions & 27 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions inc/integrations/api/form-response-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ class Form_Data_Response {
* @since 2.0.0
*/
public function __construct() {
$this->response['success'] = false;
$this->response['reasons'] = array();
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
$this->response['displayError'] = 'Error. Please try again.';
$this->response['success'] = false;
$this->response['reasons'] = array();
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
$this->response['displayError'] = 'Error. Please try again.';
$this->response['submitMessage'] = 'Success';
}

/**
Expand Down Expand Up @@ -148,6 +149,17 @@ public function set_reasons( $reasons ) {
return $this;
}

/**
* Set success message.
*
* @param string $message The message.
* @since 2.4
*/
public function set_success_message( $message ) {
$this->response['submitMessage'] = $message;
return $this;
}

/**
* Check if success.
*
Expand Down
5 changes: 5 additions & 0 deletions inc/plugins/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ private function the_otter_banner() {
.otter-banner__version {
align-self: center;
}

/* Hide the "Add New" button for Multisite WP. Second part is for Elementor */
a.page-title-action:first-of-type, #e-admin-top-bar-root:not(.e-admin-top-bar--active)~#wpbody .wrap a.page-title-action:first-of-type {
display: none;
}
</style>
<div class="otter-banner">
<div class="otter-banner__image">
Expand Down
16 changes: 9 additions & 7 deletions inc/server/class-form-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,22 @@ public function frontend( $request ) {
do_action( 'otter_form_after_submit', $form_data );

if ( ! ( $form_data instanceof Form_Data_Request ) ) {
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
$res->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
}

if ( $form_data->has_error() ) {
$res->set_code( $form_data->get_error_code() );
$res->set_code( $form_data->get_error_code() )
->set_display_error( $form_options->get_error_message() );
} else {
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND );
$res->mark_as_success();
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND )
->set_success_message( $form_options->get_submit_message() )
->mark_as_success();
}
}
} catch ( Exception $e ) {
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
$res->add_reason( $e->getMessage() );
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
->add_reason( $e->getMessage() );
$form_data->set_error( Form_Data_Response::ERROR_RUNTIME_ERROR, $e->getMessage() );
$this->send_error_email( $form_data );
} finally {
Expand Down
Loading

0 comments on commit 9318a8b

Please sign in to comment.