diff --git a/.VERSION b/.VERSION new file mode 100644 index 00000000000..ea9508f42d8 --- /dev/null +++ b/.VERSION @@ -0,0 +1 @@ +5.0.30.018 diff --git a/CHANGELOG.md b/CHANGELOG.md index f402922ebb5..ea2a195e154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Releases +### [5.0.30] + +#### Added + - [Advanced Registration Forms (#1155)](https://github.com/eventespresso/cafe/pull/1155) + - [New Self-Serve Registration Cancellation Add-on (#1581)](https://github.com/eventespresso/cafe/pull/1581) + - [Add author bundle for Loco Translate (#1602)](https://github.com/eventespresso/cafe/pull/1602) + - NEW + +#### Fixed + - [Check DbStatus::isOnline() Before Loading Service Change Notifications (#1586)](https://github.com/eventespresso/cafe/pull/1586) + - [Remove period shown when only one attendee can register (#1583)](https://github.com/eventespresso/cafe/pull/1583) + - [Welp! Just Sanitize and Return Widget Settings! (#1591)](https://github.com/eventespresso/cafe/pull/1591) + - [Fix Event Subtotal Line Item Selection When Using Event Cart (#1598)](https://github.com/eventespresso/cafe/pull/1598) + - [Fix Event Cart UI Update When Deleting Tickets (#1599)](https://github.com/eventespresso/cafe/pull/1599) + - [Fix Registration Status Updates (#1612)](https://github.com/eventespresso/cafe/pull/1612) + - [Fix iFrame CSS IDs (#1613)](https://github.com/eventespresso/cafe/pull/1613) + - [Allow Checkbox Inputs When Using Datetime Selector (#1606)](https://github.com/eventespresso/cafe/pull/1606) + - [PPC. Fix ACDC removing country field (#1621)](https://github.com/eventespresso/cafe/pull/1621) + - FIX + +#### Changed + - [BuildMachine 5.0.29 changes (#1585)](https://github.com/eventespresso/cafe/pull/1585) + - [Update Unit Tests (#1597)](https://github.com/eventespresso/cafe/pull/1597) + - [Update Registration Admin Questions Form Submission (#1593)](https://github.com/eventespresso/cafe/pull/1593) + - [Dont Load Payment Method Deprecation 2025 Notices on Event Smart (#1603)](https://github.com/eventespresso/cafe/pull/1603) + - [Update jQuery Validate to v1.19.5 (#1592)](https://github.com/eventespresso/cafe/pull/1592) + - [Improve Loco Translate bundle to include both translation filenames (#1626)](https://github.com/eventespresso/cafe/pull/1626) + - MOD + +#### Deprecated + - DEP + +#### Removed + - RMV + +#### Security + - SEC + + + ### [5.0.29] #### Fixed @@ -15,6 +55,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [BuildMachine 5.0.28 changes (#1579)](https://github.com/eventespresso/cafe/pull/1579) + + + + ### [5.0.28] #### Added @@ -41,9 +85,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - - ### [5.0.27] #### Added @@ -60,12 +101,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - - ### [5.0.26] - #### Fixed - Fixed PHP 7.4 Incompatible Code in InterfaceManager @@ -74,13 +111,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - - ### [5.0.25] - - #### Changed - [BuildMachine changes - 5.0.24.p (#1486)](https://github.com/eventespresso/cafe/pull/1486) - [Fix and Split Up PHP Unit Tests (#1354)](https://github.com/eventespresso/cafe/pull/1354) @@ -90,8 +122,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - ### [5.0.24] #### Added @@ -112,6 +142,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Add current_user_can() Check When Updating Timezone (#1475)](https://github.com/eventespresso/cafe/pull/1475) + ### [5.0.23] #### Fixed @@ -121,6 +152,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [BuildMachine 5.0.22 changes (#1450)](https://github.com/eventespresso/cafe/pull/1450) + ### [5.0.22] #### Added @@ -155,6 +187,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [BuildMachine 5.0.22 changes (#1450)](https://github.com/eventespresso/cafe/pull/1450) + ### [5.0.21] #### Fixed @@ -188,6 +221,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PPC. Add partner Fees (#1355)](https://github.com/eventespresso/cafe/pull/1355) + ### [5.0.20] #### Added @@ -228,6 +262,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [PUE to EDD Tweaks (#1268)](https://github.com/eventespresso/cafe/pull/1268) + ### [5.0.19] #### Fixed @@ -245,6 +280,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Remove Serialized Objects from Registration Report Requests (#1154)](https://github.com/eventespresso/cafe/pull/1154) + ### [5.0.18] #### Added @@ -267,6 +303,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Improve Custom Post Type Defense Against Hostile Themes and Plugins (#1136)](https://github.com/eventespresso/cafe/pull/1136) + ### [5.0.17] #### Fixed @@ -275,6 +312,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Changed - [BuildMachine 5.0.16.p changes (#1088)](https://github.com/eventespresso/cafe/pull/1088) + + ### [5.0.16] #### Fixed @@ -284,6 +323,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Changed - [BuildMachine 5.0.16.p changes (#1088)](https://github.com/eventespresso/cafe/pull/1088) + + ### [5.0.15] #### Fixed @@ -291,11 +332,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Dont set type properties of ?EEM_Base (#1074)](https://github.com/eventespresso/cafe/pull/1074) + ### [5.0.14] #### Fixed - [Fix paypal exception causing fatal on PHP7.4 (#1071)](https://github.com/eventespresso/cafe/pull/1071) + + ### [5.0.13] #### Fixed diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php index a99b98b9bec..022604ac716 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php @@ -273,7 +273,7 @@ public function validatePayment(?EE_Payment $payment, RequestInterface $request) * @param EE_Payment $payment * @param EE_Transaction $transaction * @param array $order - * @param array $billing_info + * @param array $billing * @return void * @throws EE_Error * @throws ReflectionException @@ -282,55 +282,66 @@ public static function saveBillingDetails( EE_Payment $payment, EE_Transaction $transaction, array $order, - array $billing_info + array $billing ): void { - $primary_reg = $transaction->primary_registration(); - $attendee = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null; - $payment_method = $transaction->payment_method(); - $post_meta_name = $payment_method->type_obj() instanceof EE_PMT_Base - ? 'billing_info_' . $payment_method->type_obj()->system_name() - : ''; - if (empty($order['payment_source']) || ! $attendee instanceof EE_Attendee) { + $primary_reg = $transaction->primary_registration(); + $att = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null; + if (! $att instanceof EE_Attendee) { // I guess we are done here then. Just save what we have. $payment->set_details($order); return; } - // Do we have order information from the express checkout (PayPal button) ? - $billing_info['first_name'] = $billing_info['first_name'] ?? $attendee->fname(); - $billing_info['last_name'] = $billing_info['last_name'] ?? $attendee->lname(); - $billing_info['email'] = $billing_info['email'] ?? $attendee->email(); - if (! empty($billing_info['address'])) { - $attendee->set_address($billing_info['address']); - } - if (! empty($billing_info['address2'])) { - $attendee->set_address2($billing_info['address2']); - } - if (! empty($billing_info['city'])) { - $attendee->set_city($billing_info['city']); - } - if (! empty($billing_info['state_id'])) { - $attendee->set_state((int) $billing_info['state_id']); - } - if (! empty($billing_info['country'])) { - $attendee->set_country($billing_info['country']); - } - if (! empty($billing_info['zip'])) { - $attendee->set_zip($billing_info['zip']); - } - // Or card information from advanced card fields ? - $billing_info['credit_card'] = ''; - if (! empty($order['payment_source']['card'])) { - $payer_card = $order['payment_source']['card']; - if (! empty($payer_card['name'])) { - $full_name = explode(' ', $payer_card['name']); - // Don't need to save each field because others should be populated from the billing form. - $billing_info['credit_card'] = $payer_card['last_digits'] ?? ''; - $billing_info['first_name'] = $full_name[0] ?? $attendee->fname(); - $billing_info['last_name'] = $full_name[1] ?? $attendee->lname(); + // Defaults: + $billing['credit_card'] = 'empty'; + $billing['first_name'] = empty($billing['first_name']) ? ($att->fname() ?: 'empty') : $billing['first_name']; + $billing['last_name'] = empty($billing['last_name']) ? ($att->lname() ?: 'empty') : $billing['last_name']; + $billing['email'] = empty($billing['email']) ? ($att->email() ?: 'empty') : $billing['email']; + $billing['country'] = empty($billing['country']) ? ($att->country() ?: 'empty') : $billing['country']; + $billing['city'] = empty($billing['city']) ? ($att->city() ?: 'empty') : $billing['city']; + $billing['state'] = empty($billing['state']) ? ($att->state_name() ?: 'empty') : $billing['state']; + $billing['address'] = empty($billing['address']) ? ($att->address() ?: 'empty') : $billing['address']; + $billing['address2'] = empty($billing['address2']) ? ($att->address2() ?: 'empty') : $billing['address2']; + $billing['zip'] = empty($billing['zip']) ? ($att->zip() ?: 'empty') : $billing['zip']; + $billing['phone'] = empty($billing['phone']) ? ($att->phone() ?: 'empty') : $billing['phone']; + + // Try getting the payer information from the payment source (PayPal). + if (! empty($order['payment_source'])) { + // A card (ACDC) payment ? + if (! empty($order['payment_source']['card'])) { + $payer = $order['payment_source']['card']; + // Or maybe a PayPal Express payment ? + } elseif (! empty($order['payment_source']['paypal'])) { + $payer = $order['payment_source']['paypal']; + } + if (! empty($payer)) { + if (! empty($payer['name'])) { + // Yup, payment_source card vs PayPal have different info about the payer. So need to differentiate. + if (is_string($payer['name'])) { + $full_name = explode(' ', $payer['name']); + $billing['first_name'] = $full_name[0] ?? $billing['first_name']; + $billing['last_name'] = $full_name[1] ?? $billing['last_name']; + } + // PayPal info on the Payment: + if (is_array($payer['name'])) { + $billing['first_name'] = $payer['name']['given_name'] ?? $billing['first_name']; + $billing['last_name'] = $payer['name']['surname'] ?? $billing['last_name']; + } + } + // Possible info on the payer. + $billing['credit_card'] = $payer['last_digits'] ?? $billing['credit_card']; + $billing['email'] = $payer['email_address'] ?? $billing['email']; + $billing['country'] = $payer['address']['country_code'] ?? $billing['country']; + $billing['city'] = $payer['address']['city'] ?? $billing['city']; + $billing['state'] = $payer['address']['state'] ?? $billing['state']; + $billing['address'] = $payer['address']['address'] ?? $billing['address']; + $billing['zip'] = $payer['address']['zip'] ?? $billing['zip']; } } // Update attendee billing info in the transaction details. - update_post_meta($attendee->ID(), $post_meta_name, $billing_info); - $attendee->save(); + $payment_method = $transaction->payment_method(); + $post_meta_name = $payment_method->type_obj() instanceof EE_PMT_Base + ? 'billing_info_' . $payment_method->type_obj()->system_name() + : ''; + update_post_meta($att->ID(), $post_meta_name, $billing); } } diff --git a/PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php b/PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php index e045da7cb73..60cd047e6cd 100644 --- a/PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php +++ b/PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php @@ -182,7 +182,8 @@ protected function getParameters(): array ) && ! empty($scopes) && in_array('partnerfee', $scopes) ) { - $payment_fees = LoaderFactory::getShared(PartnerPaymentFees::class); + /** @var PartnerPaymentFees $payment_fees */ + $payment_fees = LoaderFactory::getShared(PartnerPaymentFees::class); $parameters['purchase_units'][0]['payment_instruction'] = [ 'platform_fees' => [ [ diff --git a/admin_pages/about/About_Admin_Page.core.php b/admin_pages/about/About_Admin_Page.core.php index d40aa7bfeb5..ae435a0408b 100644 --- a/admin_pages/about/About_Admin_Page.core.php +++ b/admin_pages/about/About_Admin_Page.core.php @@ -43,24 +43,24 @@ protected function _set_page_routes() { $this->_page_routes = array( 'default' => array( - 'func' => '_overview', + 'func' => [$this, '_overview'], 'capability' => 'manage_options', ), // 'overview' => '_overview', - // 'func' => '_overview', + // 'func' => [$this, '_overview'], // 'capability' => 'ee_read_ee' // ), 'credits' => array( - 'func' => '_credits', + 'func' => [$this, '_credits'], 'capability' => 'manage_options', ), 'decafvpro' => array( - 'func' => '_decafvpro', + 'func' => [$this, '_decafvpro'], 'capability' => 'manage_options', ), 'reviews' => array( - 'func' => '_reviews', + 'func' => [$this, '_reviews'], 'capability' => 'manage_options', ), ); diff --git a/admin_pages/general_settings/AdminOptionsSettings.php b/admin_pages/general_settings/AdminOptionsSettings.php index a4667f06d51..8f210df0099 100644 --- a/admin_pages/general_settings/AdminOptionsSettings.php +++ b/admin_pages/general_settings/AdminOptionsSettings.php @@ -6,6 +6,7 @@ use EE_Error; use EE_Form_Section_HTML; use EE_Form_Section_Proper; +use EE_Registry; use EE_Text_Input; use EE_Yes_No_Input; use EEH_HTML; @@ -30,9 +31,9 @@ class AdminOptionsSettings extends FormHandler /** * Form constructor. * - * @param \EE_Registry $registry + * @param EE_Registry $registry */ - public function __construct(\EE_Registry $registry) + public function __construct(EE_Registry $registry) { parent::__construct( esc_html__('Admin Options', 'event_espresso'), diff --git a/admin_pages/maintenance/Maintenance_Admin_Page.core.php b/admin_pages/maintenance/Maintenance_Admin_Page.core.php index edb239c2922..84641de0ee3 100644 --- a/admin_pages/maintenance/Maintenance_Admin_Page.core.php +++ b/admin_pages/maintenance/Maintenance_Admin_Page.core.php @@ -353,6 +353,7 @@ public function _maintenance() esc_html__("EE%s", 'event_espresso'), espresso_version() ), + 'real_level' => $this->maintenance_mode->real_level(), ] ); } diff --git a/admin_pages/maintenance/templates/ee_migration_page.template.php b/admin_pages/maintenance/templates/ee_migration_page.template.php index df7c9dc5e69..3c7b52d9e16 100644 --- a/admin_pages/maintenance/templates/ee_migration_page.template.php +++ b/admin_pages/maintenance/templates/ee_migration_page.template.php @@ -20,9 +20,10 @@ * @var string $ultimate_db_state * @var string $reset_db_page_link * @var string $migration_options_html + * @var int $real_level */ -$m_mode_active = MaintenanceStatus::isNotDisabled(); +$m_mode_active = MaintenanceStatus::isNotDisabled() || $real_level !== EE_Maintenance_Mode::STATUS_OFF; if ($show_backup_db_text) { ?>

diff --git a/admin_pages/messages/Messages_Admin_Page.core.php b/admin_pages/messages/Messages_Admin_Page.core.php index bba9d348c0a..6f5c86f6589 100644 --- a/admin_pages/messages/Messages_Admin_Page.core.php +++ b/admin_pages/messages/Messages_Admin_Page.core.php @@ -2393,6 +2393,7 @@ public function shortcode_meta_box() ); ?>

_page_routes = array( 'default' => array( - 'func' => '_other_services', + 'func' => [$this, '_other_services'], 'capability' => 'ee_read_ee', ), ); diff --git a/admin_pages/payments/Payments_Admin_Page.core.php b/admin_pages/payments/Payments_Admin_Page.core.php index 538b144ca91..f41c9d3a30e 100644 --- a/admin_pages/payments/Payments_Admin_Page.core.php +++ b/admin_pages/payments/Payments_Admin_Page.core.php @@ -88,40 +88,40 @@ protected function _set_page_routes() **/ $this->_page_routes = [ 'default' => [ - 'func' => '_payment_methods_list', + 'func' => [$this, '_payment_methods_list'], 'capability' => 'ee_edit_payment_methods', ], 'payment_settings' => [ - 'func' => '_payment_settings', + 'func' => [$this, '_payment_settings'], 'capability' => 'ee_manage_gateways', ], 'activate_payment_method' => [ - 'func' => '_activate_payment_method', + 'func' => [$this, '_activate_payment_method'], 'noheader' => true, 'capability' => 'ee_edit_payment_methods', ], 'deactivate_payment_method' => [ - 'func' => '_deactivate_payment_method', + 'func' => [$this, '_deactivate_payment_method'], 'noheader' => true, 'capability' => 'ee_delete_payment_methods', ], 'update_payment_method' => [ - 'func' => '_update_payment_method', + 'func' => [$this, '_update_payment_method'], 'noheader' => true, 'headers_sent_route' => 'default', 'capability' => 'ee_edit_payment_methods', ], 'update_payment_settings' => [ - 'func' => '_update_payment_settings', + 'func' => [$this, '_update_payment_settings'], 'noheader' => true, 'capability' => 'ee_manage_gateways', ], 'payment_log' => [ - 'func' => '_payment_log_overview_list_table', + 'func' => [$this, '_payment_log_overview_list_table'], 'capability' => 'ee_read_payment_methods', ], 'payment_log_details' => [ - 'func' => '_payment_log_details', + 'func' => [$this, '_payment_log_details'], 'capability' => 'ee_read_payment_methods', ], ]; diff --git a/admin_pages/registration_form/Registration_Form_Admin_Page.core.php b/admin_pages/registration_form/Registration_Form_Admin_Page.core.php index c70e14d2d61..5d52a9987ce 100644 --- a/admin_pages/registration_form/Registration_Form_Admin_Page.core.php +++ b/admin_pages/registration_form/Registration_Form_Admin_Page.core.php @@ -1,6 +1,7 @@ _page_routes = [ 'default' => [ - 'func' => '_questions_overview_list_table', + 'func' => [$this, '_questions_overview_list_table'], 'capability' => 'ee_read_questions', ], 'edit_question' => [ - 'func' => '_edit_question', + 'func' => [$this, '_edit_question'], 'capability' => 'ee_edit_question', 'obj_id' => $qst_id, 'args' => ['edit'], ], 'question_groups' => [ - 'func' => '_questions_groups_preview', + 'func' => [$this, '_questions_groups_preview'], 'capability' => 'ee_read_question_groups', ], 'update_question' => [ - 'func' => '_insert_or_update_question', + 'func' => [$this, '_insert_or_update_question'], 'args' => ['new_question' => false], 'capability' => 'ee_edit_question', 'obj_id' => $qst_id, @@ -260,18 +246,12 @@ public function load_scripts_styles_default() } - /** - * @throws EE_Error - */ public function load_scripts_styles_add_question() { $this->load_scripts_styles_question_details(); } - /** - * @throws EE_Error - */ public function load_scripts_styles_edit_question() { $this->load_scripts_styles_question_details(); @@ -280,9 +260,6 @@ public function load_scripts_styles_edit_question() /** * Loads the JS required for adding or editing a question - * - * @throws EE_Error - * @throws EE_Error */ protected function load_scripts_styles_question_details() { @@ -299,8 +276,8 @@ protected function load_scripts_styles_question_details() 'espresso_registration_form_single', 'ee_question_data', [ - 'question_types_with_max' => EEM_Question::instance()->questionTypesWithMaxLength(), - 'question_type_with_options' => EEM_Question::instance()->question_types_with_options(), + 'question_types_with_max' => $this->_question_model->questionTypesWithMaxLength(), + 'question_type_with_options' => $this->_question_model->question_types_with_options(), ] ); } @@ -308,8 +285,7 @@ protected function load_scripts_styles_question_details() public function recaptcha_info_help_tab() { - $template = REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php'; - EEH_Template::display_template($template, []); + EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH . 'recaptcha_info_help_tab.template.php'); } @@ -363,10 +339,10 @@ protected function _questions_groups_preview() 'event_espresso' ) . '" />'; $this->_template_args['preview_text'] = '' - . esc_html__( - 'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.', - 'event_espresso' - ) . ''; + . esc_html__( + 'Question Groups is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. With the Question Groups feature you are able to create new question groups, edit existing question groups, and create and edit new questions and add them to question groups.', + 'event_espresso' + ) . ''; $this->display_admin_caf_preview_page('question_groups_tab'); } @@ -377,74 +353,80 @@ protected function _questions_groups_preview() * @param EEM_Base $model * @return array where each key is the name of a model's field/db column, and each value is its value. * @throws EE_Error + * @throws ReflectionException */ - protected function _set_column_values_for(EEM_Base $model) + protected function _set_column_values_for(EEM_Base $model): array { - $question_model = EEM_Question::instance(); - $set_column_values = []; - + $column_values = []; // some initial checks for proper values. + $QST_ID = $this->request->getRequestParam('QST_ID', 0, DataType::INT); // if QST_admin_only, then no matter what QST_required is we disable. - if (! empty($this->_req_data['QST_admin_only'])) { - $this->_req_data['QST_required'] = 0; + $QST_admin_only = $this->request->getRequestParam('QST_admin_only', false, DataType::BOOL); + if ($QST_admin_only) { + $this->request->setRequestParam('QST_required', false); } // if the question shouldn't have a max length, don't let them set one if ( - ! isset( - $this->_req_data['QST_type'], - $this->_req_data['QST_max'] - ) - || ! in_array( - $this->_req_data['QST_type'], - $question_model->questionTypesWithMaxLength(), + ! ( + $this->request->requestParamIsSet('QST_type') + && $this->request->requestParamIsSet('QST_max') + ) || ! in_array( + $this->request->getRequestParam('QST_type', '', DataType::STRING), + $this->_question_model->questionTypesWithMaxLength(), true ) ) { // they're not allowed to set the max - $this->_req_data['QST_max'] = null; + $this->request->unSetRequestParam('QST_max', true); } foreach ($model->field_settings() as $fieldName => $settings) { - // basically if QSG_identifier is empty or not set - if ( - $fieldName === 'QSG_identifier' - && (isset($this->_req_data['QSG_identifier']) && empty($this->_req_data['QSG_identifier'])) - ) { - $QSG_name = $this->_req_data['QSG_name'] ?? ''; - $set_column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true); - } elseif ( - $fieldName === 'QST_admin_label' - && (isset($this->_req_data['QST_admin_label']) && empty($this->_req_data['QST_admin_label'])) - ) { - // the admin label is blank, use a slug version of the question text - $QST_text = $this->_req_data['QST_display_text'] ?? ''; - $set_column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10)); - } elseif ($fieldName === 'QST_admin_only' && (! isset($this->_req_data['QST_admin_only']))) { - $set_column_values[ $fieldName ] = 0; - } elseif ($fieldName === 'QST_max') { - $qst_system = $question_model->get_var( - [ - [ - 'QST_ID' => $this->_req_data['QST_ID'] ?? 0, - ], - ], - 'QST_system' - ); - $max_max = $question_model->absolute_max_for_system_question((string) $qst_system); - if (empty($this->_req_data['QST_max']) || $this->_req_data['QST_max'] > $max_max) { - $set_column_values[ $fieldName ] = $max_max; - } - } + switch($fieldName) { + case 'QSG_identifier': + // basically if QSG_identifier is empty or not set + if (! $this->request->getRequestParam('QSG_identifier', '', DataType::STRING)) { + $QSG_name = $this->request->getRequestParam('QSG_name', '', DataType::STRING); + $column_values[ $fieldName ] = sanitize_title($QSG_name) . '-' . uniqid('', true); + } + break; + case 'QST_admin_label': + if (! $this->request->getRequestParam('QST_admin_label', '', DataType::STRING)) { + // the admin label is blank, use a slug version of the question text + $QST_text = $this->request->getRequestParam('QST_display_text', '', DataType::STRING); + $column_values[ $fieldName ] = sanitize_title(wp_trim_words($QST_text, 10)); + } + break; - // only add a property to the array if it's not null (otherwise the model should just use the default value) - if ( - ! isset($set_column_values[ $fieldName ]) && isset($this->_req_data[ $fieldName ]) - ) { - $set_column_values[ $fieldName ] = $this->_req_data[ $fieldName ]; + case 'QST_admin_only': + if (! $QST_admin_only) { + $column_values[ $fieldName ] = false; + } + break; + + case 'QST_max': + $qst_system = $this->_question_model->get_var( + [ [ 'QST_ID' => $QST_ID ] ], + 'QST_system' + ); + + $max_max = $this->_question_model->absolute_max_for_system_question((string) $qst_system); + $QST_max = $this->request->getRequestParam('QST_max', 0, DataType::INT); + if ($QST_max === 0 || $QST_max > $max_max) { + $column_values[ $fieldName ] = $max_max; + } + break; + + default: + // only add a property to the array if it's not null (otherwise the model should just use the default value) + if ($this->request->requestParamIsSet($fieldName)) { + // convert the schema type to the appropriate data type + $schema_type = DataType::convertModelFieldSchemaType($settings->getSchemaType()); + $column_values[ $fieldName ] = $this->request->getRequestParam($fieldName, null, $schema_type); + } } } - // validation fo this data to be performed by the model before insertion. - return $set_column_values; + // validation for this data to be performed by the model before insertion. + return $column_values; } @@ -499,7 +481,7 @@ protected function _edit_question() } if ($question->system_ID() === EEM_Attendee::system_question_phone) { $question_types = array_intersect_key( - EEM_Question::instance()->allowed_question_types(), + $this->_question_model->allowed_question_types(), array_flip( [ EEM_Question::QST_type_text, @@ -516,11 +498,11 @@ protected function _edit_question() $this->_template_args['question'] = $question; $this->_template_args['question_types'] = $question_types; $this->_template_args['max_max'] = - EEM_Question::instance()->absolute_max_for_system_question( + $this->_question_model->absolute_max_for_system_question( $question->system_ID() ); $this->_template_args['question_type_descriptions'] = $this->_get_question_type_descriptions(); - $this->_set_publish_post_box_vars('id', $ID, '', '', true); + $this->_set_publish_post_box_vars('id', $ID); $this->_template_args['admin_page_content'] = EEH_Template::display_template( REGISTRATION_FORM_TEMPLATE_PATH . 'questions_main_meta_box.template.php', $this->_template_args, @@ -537,11 +519,11 @@ protected function _edit_question() * @throws EE_Error * @throws ReflectionException */ - protected function _get_question_type_descriptions() + protected function _get_question_type_descriptions(): string { EE_Registry::instance()->load_helper('HTML'); $descriptions = ''; - $question_type_descriptions = EEM_Question::instance()->question_descriptions(); + $question_type_descriptions = $this->_question_model->question_descriptions(); foreach ($question_type_descriptions as $type => $question_type_description) { if ($type == 'HTML_TEXTAREA') { $html = new EE_Simple_HTML_Validation_Strategy(); @@ -563,18 +545,20 @@ protected function _get_question_type_descriptions() /** - * @param bool|true $new_question + * @param bool $new_question * @throws EE_Error * @throws ReflectionException */ - protected function _insert_or_update_question($new_question = true) + protected function _insert_or_update_question(bool $new_question = true) { $set_column_values = $this->_set_column_values_for($this->_question_model); if ($new_question) { $question = EE_Question::new_instance($set_column_values); $action_desc = 'added'; } else { - $question = EEM_Question::instance()->get_one_by_ID(absint($this->_req_data['QST_ID'])); + $question = $this->_question_model->get_one_by_ID( + $this->request->getRequestParam('QST_ID', 0, DataType::INT) + ); foreach ($set_column_values as $field => $new_value) { $question->set($field, $new_value); } @@ -586,12 +570,15 @@ protected function _insert_or_update_question($new_question = true) // save the related options // trash removed options, save old ones // get list of all options - $options = $question->options(); + $options = $question->options(); + $question_options = $this->request->getRequestParam('question_options', [], DataType::ARRAY); + $QSO_default = $this->request->getRequestParam('QSO_default', null, DataType::INT); if (! empty($options)) { foreach ($options as $option_ID => $option) { $option_req_index = $this->_get_option_req_data_index($option_ID); if ($option_req_index !== false) { - $option->save($this->_req_data['question_options'][ $option_req_index ]); + $question_options[ $option_req_index ]['QSO_default'] = $option_req_index === $QSO_default; + $option->save($question_options[ $option_req_index ]); } else { // not found, remove it $option->delete(); @@ -599,7 +586,7 @@ protected function _insert_or_update_question($new_question = true) } } // save new related options - foreach ($this->_req_data['question_options'] as $index => $option_req_data) { + foreach ($question_options as $index => $option_req_data) { // skip $index that is from our sample if ($index === 'xxcountxx') { continue; @@ -609,16 +596,25 @@ protected function _insert_or_update_question($new_question = true) // no ID! save it! $new_option = EE_Question_Option::new_instance( [ - 'QSO_value' => $option_req_data['QSO_value'], - 'QSO_desc' => $option_req_data['QSO_desc'], - 'QSO_order' => $option_req_data['QSO_order'], - 'QST_ID' => $question->ID(), + 'QSO_value' => $option_req_data['QSO_value'], + 'QSO_desc' => $option_req_data['QSO_desc'], + 'QSO_default' => $index === $QSO_default, + 'QSO_order' => $option_req_data['QSO_order'], + 'QST_ID' => $question->ID(), ] ); $new_option->save(); } } } + + $success = apply_filters( + 'FHEE__Registration_Form_Admin_Page___insert_or_update_question__success', + (int) $success, + $question, + $this + ); + $query_args = ['action' => 'edit_question', 'QST_ID' => $ID]; if ($success !== 0) { $msg = $new_question @@ -646,7 +642,7 @@ protected function _insert_or_update_question($new_question = true) * @param int $ID of the question option to find * @return int index in question_options array if successful, FALSE if unsuccessful */ - protected function _get_option_req_data_index($ID) + protected function _get_option_req_data_index(int $ID) { $req_data_for_question_options = $this->_req_data['question_options']; foreach ($req_data_for_question_options as $num => $option_data) { @@ -660,7 +656,6 @@ protected function _get_option_req_data_index($ID) - /***********/ /* QUERIES */ /** * For internal use in getting all the query parameters @@ -670,31 +665,26 @@ protected function _get_option_req_data_index($ID) * @param EEM_Base $model either EEM_Question or EEM_Question_Group * @param int $per_page * @param int $current_page - * @return array model query params, @see - * https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md + * @return array model query params, + * @see https://github.com/eventespresso/event-espresso-core/tree/master/docs/G--Model-System/model-query-params.md */ - protected function get_query_params($model, $per_page = 10, $current_page = 10) + protected function get_query_params(EEM_Base $model, int $per_page = 10, int $current_page = 10): array { $query_params = []; $offset = ($current_page - 1) * $per_page; $query_params['limit'] = [$offset, $per_page]; - $order = - (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) - ? $this->_req_data['order'] - : 'ASC'; - $orderby_field = - $model instanceof EEM_Question - ? 'QST_ID' - : 'QSG_order'; - $field_to_order_by = - empty($this->_req_data['orderby']) - ? $orderby_field - : $this->_req_data['orderby']; + + $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) + ? $this->_req_data['order'] + : 'ASC'; + + $orderby_field = $model instanceof EEM_Question ? 'QST_ID' : 'QSG_order'; + + $field_to_order_by = empty($this->_req_data['orderby']) ? $orderby_field : $this->_req_data['orderby']; + $query_params['order_by'] = [$field_to_order_by => $order]; - $search_string = - array_key_exists('s', $this->_req_data) - ? $this->_req_data['s'] - : null; + + $search_string = array_key_exists('s', $this->_req_data) ? $this->_req_data['s'] : null; if (! empty($search_string)) { if ($model instanceof EEM_Question_Group) { $query_params[0] = [ @@ -710,9 +700,15 @@ protected function get_query_params($model, $per_page = 10, $current_page = 10) } } - // capability checks (just leaving this commented out for reference because it illustrates some complicated query params that could be useful when fully implemented) + // capability checks (just leaving this commented out for reference because + // it illustrates some complicated query params that could be useful when fully implemented) /*if ( $model instanceof EEM_Question_Group ) { - if ( ! $this->capabilities->current_user_can( 'edit_others_question_groups', 'espresso_registration_form_edit_question_group' ) ) { + if ( + ! $this->capabilities->current_user_can( + 'edit_others_question_groups', + 'espresso_registration_form_edit_question_group' + ) + ) { $query_params[0] = array( 'AND' => array( 'OR' => array( @@ -726,7 +722,12 @@ protected function get_query_params($model, $per_page = 10, $current_page = 10) ); } } else { - if ( ! $this->capabilities->current_user_can( 'edit_others_questions', 'espresso_registration_form_edit_question' ) ) { + if ( + ! $this->capabilities->current_user_can( + 'edit_others_questions', + 'espresso_registration_form_edit_question' + ) + ) { $query_params[0] = array( 'AND' => array( 'OR' => array( @@ -746,62 +747,54 @@ protected function get_query_params($model, $per_page = 10, $current_page = 10) /** - * @param int $per_page - * @param int $current_page - * @param bool|false $count - * @return EE_Base_Class[]|EE_Question_Group[]|EE_Soft_Delete_Base_Class[]|int + * @param int $per_page + * @param int $current_page + * @param bool $count + * @return EE_Question[]|int * @throws EE_Error + * @throws ReflectionException */ - public function get_questions($per_page = 10, $current_page = 1, $count = false) + public function get_questions(int $per_page = 10, int $current_page = 1, bool $count = false) { - $QST = EEM_Question::instance(); - $query_params = $this->get_query_params($QST, $per_page, $current_page); + $query_params = $this->get_query_params($this->_question_model, $per_page, $current_page); if ($count) { - $where = - isset($query_params[0]) - ? [$query_params[0]] - : []; - $results = $QST->count($where); - } else { - $results = $QST->get_all($query_params); + $where = isset($query_params[0]) ? [$query_params[0]] : []; + return $this->_question_model->count($where); } - return $results; + return $this->_question_model->get_all($query_params); } /** - * @param $per_page - * @param int $current_page - * @param bool|false $count + * @param int $per_page + * @param int $current_page + * @param bool $count * @return EE_Soft_Delete_Base_Class[]|int * @throws EE_Error */ - public function get_trashed_questions($per_page, $current_page = 1, $count = false) + public function get_trashed_questions(int $per_page, int $current_page = 1, bool $count = false) { - $query_params = $this->get_query_params(EEM_Question::instance(), $per_page, $current_page); - $where = - isset($query_params[0]) - ? [$query_params[0]] - : []; + $query_params = $this->get_query_params($this->_question_model, $per_page, $current_page); + $where = isset($query_params[0]) ? [$query_params[0]] : []; return $count - ? EEM_Question::instance()->count_deleted($where) - : EEM_Question::instance()->get_all_deleted($query_params); + ? $this->_question_model->count_deleted($where) + : $this->_question_model->get_all_deleted($query_params); } /** - * @param $per_page - * @param int $current_page - * @param bool|false $count - * @return EE_Base_Class[]|EE_Question_Group[]|EE_Soft_Delete_Base_Class[] + * @param int $per_page + * @param int $current_page + * @param bool $count + * @return EE_Question_Group[]|int * @throws EE_Error + * @throws ReflectionException */ - public function get_question_groups($per_page, $current_page = 1, $count = false) + public function get_question_groups(int $per_page, int $current_page = 1, bool $count = false) { - $questionGroupModel = EEM_Question_Group::instance(); // note: this a subclass of EEM_Soft_Delete_Base, so this is actually only getting non-trashed items - return $questionGroupModel->get_all( - $this->get_query_params($questionGroupModel, $per_page, $current_page) + return $this->_question_group_model->get_all( + $this->get_query_params($this->_question_group_model, $per_page, $current_page) ); } } diff --git a/admin_pages/registration_form/assets/espresso_registration_form_admin.css b/admin_pages/registration_form/assets/espresso_registration_form_admin.css index 0d76d65a57d..03a0d5b0f78 100644 --- a/admin_pages/registration_form/assets/espresso_registration_form_admin.css +++ b/admin_pages/registration_form/assets/espresso_registration_form_admin.css @@ -2,8 +2,7 @@ Document : espresso_registration_forms_admin Created on : 29-Jan-2013, 10:30:18 AM Author : mnelson4 - Description: - Purpose of the stylesheet follows. + Description: Purpose of the stylesheet follows. */ #question_options .sample{ display:none; } @@ -32,7 +31,6 @@ width: clamp(4rem, 15%, 8rem); } -/* .question-group-questions-container { display:inline-block; width: 30%; } */ .ee-question-sortable { cursor: move;} .ee-question-sortable label { cursor: inherit;} @@ -87,16 +85,6 @@ flex-flow: row wrap; } -/* #insert_question_group_event_form .edit-group, */ -/* #update_question_group_event_form .edit-group { */ -/* width: clamp(400px, 800px, 100%) */ -/* } */ - -/* #insert_question_group_event_form .edit-group + .edit-group, */ -/* #update_question_group_event_form .edit-group + .edit-group { */ -/* margin-block-start: 2rem; */ -/* margin-inline-start: unset; */ -/* } */ #update_question_group_event_form .edit-group > h2, #insert_question_group_event_form .edit-group > h2 { margin-block-start: unset; @@ -131,12 +119,9 @@ } .espresso-admin .form-table #question_options table.question-options-table td input:not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="checkbox"]) { margin-inline-start: .25rem; - /* min-width: unset; */ } -.espresso-admin #new-question-option { - margin-block-start: 1rem; -} + .espresso-admin .form-table .question-options-table tr { flex-flow: column nowrap; } @@ -168,16 +153,34 @@ .espresso-admin .form-table #question_options { --ee-option-actions-width: calc(((var(--ee-button-height) + (var(--ee-margin-nano) * 2)) * 2) + var(--ee-margin-nano)); - --ee-option-value-width: calc(((100% - var(--ee-option-actions-width)) * .33) - var(--ee-margin-nano)); - --ee-option-desc-width: calc(((100% - var(--ee-option-actions-width)) * .66) - var(--ee-margin-nano)); + --ee-option-default-width: 5rem; + --ee-other-cells-width: calc(100% - var(--ee-option-actions-width) - var(--ee-option-default-width) - var(--ee-margin-micro)); + --ee-option-value-width: calc(var(--ee-other-cells-width) * .33); + --ee-option-desc-width: calc(var(--ee-other-cells-width) * .66); + --ee-option-double-wide: calc(var(--ee-other-cells-width) * .99); } +.espresso-admin .form-table #question_options table.question-options-table th { + align-items: baseline; +} .espresso-admin .form-table #question_options table.question-options-table td select, .espresso-admin .form-table #question_options table.question-options-table td input[type="text"] { max-width: 100%; } +.espresso-admin .form-table #question_options table.question-options-table + .ee-admin-button-row { + margin-block-start: 0; +} @media screen and (min-width:600px) { + .espresso-admin .form-table #question_options table.question-options-table td.no-default-label { + padding-block: 0.875rem; + } + .espresso-admin .form-table #question_options table.question-options-table td.no-default-label label { + font-weight: 400; + margin-block-start: 0; + margin-inline-start: auto; + text-align: end; + } .espresso-admin .form-table #question_options table.question-options-table th.option-value-header, .espresso-admin .form-table #question_options table.question-options-table td.option-value-cell { display: inline-flex; @@ -191,6 +194,18 @@ padding-inline-end: .5rem; width: var(--ee-option-desc-width); } + + .espresso-admin .form-table #question_options table.question-options-table th.option-default-header, + .espresso-admin .form-table #question_options table.question-options-table td.option-default-cell { + display: inline-flex; + justify-content: center; + padding-inline: .5rem; + width: var(--ee-option-default-width); + } + .espresso-admin .form-table #question_options table.question-options-table td.option-default-cell { + padding-block: .875rem; + } + .espresso-admin .form-table #question_options table.question-options-table th.option-actions-header, .espresso-admin .form-table #question_options table.question-options-table td.option-actions-cell { display: inline-flex; @@ -202,16 +217,8 @@ padding-inline-end: 0; } } -/* @media screen and (min-width:1024px) { */ -/* .espresso-admin .form-table .question-options-table th, */ -/* .espresso-admin .form-table .question-options-table td { */ -/* flex: 4 1 auto; */ -/* } */ -/* .espresso-admin .form-table .question-options-table th:first-child, */ -/* .espresso-admin .form-table .question-options-table td:first-child { */ -/* flex: 2 1.25 auto; */ -/* } */ -/* } */ + + @media screen and (min-width: 1920px) { #group-details { width: calc(100% - 25rem); diff --git a/admin_pages/registration_form/assets/espresso_registration_form_admin.js b/admin_pages/registration_form/assets/espresso_registration_form_admin.js index c0ec901a907..3089dcdcd61 100644 --- a/admin_pages/registration_form/assets/espresso_registration_form_admin.js +++ b/admin_pages/registration_form/assets/espresso_registration_form_admin.js @@ -84,7 +84,7 @@ function espresso_reg_forms_add_option(){ const newContent = newRowHtml.replace(new RegExp("xxcountxx", 'g'), count); //add to dom - $question_options.find('tr:last').after(newContent); + $question_options.find('tr:last').before(newContent); //add new count to dom. $question_options_count.val(count); diff --git a/admin_pages/registration_form/templates/questions_main_meta_box.template.php b/admin_pages/registration_form/templates/questions_main_meta_box.template.php index 4a3ec1bae83..6de24fcca85 100644 --- a/admin_pages/registration_form/templates/questions_main_meta_box.template.php +++ b/admin_pages/registration_form/templates/questions_main_meta_box.template.php @@ -1,36 +1,29 @@ system_ID() - ), + EEH_Form_Fields::hidden_input('QST_system', $question->system_ID()), AllowedTags::getWithFormTags() ); echo wp_kses( - EEH_Form_Fields::hidden_input( - 'QST_wp_user', - $question->wp_user() - ), + EEH_Form_Fields::hidden_input('QST_wp_user', $question->wp_user()), AllowedTags::getWithFormTags() ); echo wp_kses( - EEH_Form_Fields::hidden_input( - 'QST_deleted', - $question->deleted() - ), + EEH_Form_Fields::hidden_input('QST_deleted', $question->deleted()), AllowedTags::getWithFormTags() ); @@ -44,7 +37,6 @@ global $allowedposttags; $info_box = ''; if ($QST_system === 'country') { - // already escaped $info_box = EEH_HTML::div( EEH_HTML::h3( ' ' @@ -62,9 +54,8 @@ 'ee-info-box' ); } - ?> - - + do_action('AHEE__questions_main_meta_box__template__inner_admin_page_content', $question); +?>
@@ -75,7 +66,10 @@ @@ -84,6 +78,7 @@ name="QST_display_text" type="text" value="get_f('QST_display_text')); ?>" + required /> @@ -96,7 +91,9 @@ @@ -115,7 +112,7 @@ value="admin_label()); ?>" /> -
+

@@ -140,7 +137,7 @@ @@ -154,7 +151,7 @@ esc_attr_e($checked); ?> /> -
+

@@ -171,7 +168,7 @@ @@ -264,232 +261,317 @@ class="ee-input-width--tiny" - - - - - - - - - - - - - +
- - - - -
- - - - -
+

+ + + + +
+
-

- -

- -

+

+ ) ?> +
+ + +

- - - + +

+ +

+ + + @@ -524,7 +606,10 @@ class="description" 'event_espresso' ) ?>

-
@@ -2269,7 +2322,7 @@ public function form_after_question_group($output) * @return string * @deprecated as of 4.8.32.rc.000 */ - public function form_form_field_label_wrap($label) + public function form_form_field_label_wrap(string $label): string { EE_Error::doing_it_wrong( __CLASS__ . '::' . __FUNCTION__, @@ -2294,7 +2347,7 @@ public function form_form_field_label_wrap($label) * @return string * @deprecated as of 4.8.32.rc.000 */ - public function form_form_field_input__wrap($input) + public function form_form_field_input__wrap(string $input): string { EE_Error::doing_it_wrong( __CLASS__ . '::' . __FUNCTION__, @@ -2353,7 +2406,7 @@ protected function _update_attendee_registration_form() * @throws InvalidInterfaceException * @throws ReflectionException */ - protected function _get_reg_custom_questions_form($REG_ID) + protected function _get_reg_custom_questions_form(int $REG_ID): EE_Registration_Custom_Questions_Form { if (! $this->_reg_custom_questions_form) { require_once(REG_ADMIN . 'form_sections/EE_Registration_Custom_Questions_Form.form.php'); @@ -2377,7 +2430,7 @@ protected function _get_reg_custom_questions_form($REG_ID) * @throws InvalidInterfaceException * @throws ReflectionException */ - private function _save_reg_custom_questions_form($REG_ID = 0) + private function _save_reg_custom_questions_form($REG_ID = 0): bool { if (! $REG_ID) { EE_Error::add_error( @@ -2717,26 +2770,11 @@ protected function _delete_registrations() * @throws InvalidInterfaceException * @throws ReflectionException */ - protected function _delete_registration(EE_Registration $REG) + protected function _delete_registration(EE_Registration $REG): bool { // first we start with the transaction... ultimately, we WILL not delete permanently if there are any related // registrations on the transaction that are NOT trashed. - $TXN = $REG->transaction(); - if (! $TXN instanceof EE_Transaction) { - EE_Error::add_error( - sprintf( - esc_html__( - 'Unable to permanently delete registration %d because its related transaction has already been deleted. If you can restore the related transaction to the database then this registration can be deleted.', - 'event_espresso' - ), - $REG->id() - ), - __FILE__, - __FUNCTION__, - __LINE__ - ); - return false; - } + $TXN = $REG->transaction(); $REGS = $TXN->get_many_related('Registration'); $all_trashed = true; foreach ($REGS as $registration) { @@ -2803,6 +2841,7 @@ protected function _delete_registration(EE_Registration $REG) * @throws InvalidDataTypeException * @throws InvalidInterfaceException * @throws ReflectionException + * @throws Throwable */ public function new_registration() { @@ -2839,16 +2878,16 @@ public function new_registration() EVENTS_ADMIN_URL ); $edit_event_lnk = '' - . esc_html__('Edit Event', 'event_espresso') - . ''; + . $edit_event_url + . '" aria-label="' + . esc_attr__('Edit ', 'event_espresso') + . $this->_reg_event->name() + . '">' + . esc_html__('Edit Event', 'event_espresso') + . ''; $this->_template_args['event_name'] .= ' ' - . $edit_event_lnk - . ''; + . $edit_event_lnk + . ''; } $this->_template_args['step_content'] = $this->_get_registration_step_content(); if ($this->request->isAjax()) { @@ -2878,8 +2917,9 @@ public function new_registration() * @throws InvalidDataTypeException * @throws InvalidInterfaceException * @throws ReflectionException + * @throws Throwable */ - protected function _get_registration_step_content() + protected function _get_registration_step_content(): string { if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) { $warning_msg = sprintf( @@ -2901,9 +2941,9 @@ protected function _get_registration_step_content()