Skip to content

Commit

Permalink
Latest cafe changes 5.0.30.p
Browse files Browse the repository at this point in the history
  • Loading branch information
Pebblo committed Nov 25, 2024
1 parent f069611 commit 4df04c4
Show file tree
Hide file tree
Showing 178 changed files with 47,159 additions and 3,084 deletions.
1 change: 1 addition & 0 deletions .VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.0.30.018
72 changes: 58 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -41,9 +85,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0






### [5.0.27]

#### Added
Expand All @@ -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

Expand All @@ -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)
Expand All @@ -90,8 +122,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0





### [5.0.24]

#### Added
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -284,18 +323,23 @@ 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
- [Remove mixed return and parameter type (available in PHP8) (#1073)](https://github.com/eventespresso/cafe/pull/1073)
- [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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
3 changes: 2 additions & 1 deletion PaymentMethods/PayPalCommerce/api/orders/CreateOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
[
Expand Down
10 changes: 5 additions & 5 deletions admin_pages/about/About_Admin_Page.core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
);
Expand Down
5 changes: 3 additions & 2 deletions admin_pages/general_settings/AdminOptionsSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'),
Expand Down
1 change: 1 addition & 0 deletions admin_pages/maintenance/Maintenance_Admin_Page.core.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ public function _maintenance()
esc_html__("EE%s", 'event_espresso'),
espresso_version()
),
'real_level' => $this->maintenance_mode->real_level(),
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) { ?>
<h1><span class="dashicons dashicons-migrate"></span>
Expand Down
Loading

0 comments on commit 4df04c4

Please sign in to comment.