Skip to content

Commit

Permalink
Merge pull request #3358 from the-events-calendar/fix/prevent-fatal-w…
Browse files Browse the repository at this point in the history
…ith-index-on-4-byte-collations

Prevent fatal while creating Sessions table for Seating on environments with limited character length on indexes
  • Loading branch information
dpanta94 authored Oct 30, 2024
2 parents 7ae7340 + 5a0b5dc commit 031bb43
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-prevent-fatal-with-index-on-4-byte-collations
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Resolved a fatal error that prevented the Sessions table from being set up on some databases with stricter settings. [ET-2262]
2 changes: 1 addition & 1 deletion src/Tickets/Seating/Tables/Sessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function get_definition() {

return "
CREATE TABLE `{$table_name}` (
`token` varchar(255) NOT NULL,
`token` varchar(150) NOT NULL,
`object_id` bigint(20) NOT NULL,
`expiration` int(11) NOT NULL,
`reservations` longblob DEFAULT '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace TEC\Tickets\Commerce\Shortcodes;

use Codeception\TestCase\WPTestCase;
use Illuminate\Support\Arr;
use Spatie\Snapshots\MatchesSnapshots;
use TEC\Tickets\Commerce\Cart;
use TEC\Tickets\Commerce\Cart\Unmanaged_Cart;
Expand All @@ -14,6 +13,8 @@
use Tribe\Tests\Traits\With_Uopz;
use Tribe\Tickets\Test\Commerce\TicketsCommerce\Ticket_Maker;
use Tribe\Tickets\Test\Traits\With_Tickets_Commerce;
use Tribe__Main as Common_Plugin;
use Tribe__Tickets__Main as Tickets_Plugin;

class Checkout_ShortcodeTest extends WPTestCase {
use MatchesSnapshots;
Expand Down Expand Up @@ -104,12 +105,16 @@ public function ticket_on_sale_should_match_html() {
$this->ticket_id1,
$this->ticket_id2,
'wp-content/plugins/the-events-calendar/common',
'ver=' . Common_Plugin::VERSION,
'ver=' . Tickets_Plugin::VERSION,
],
[
'{{page_id}}',
'{{ticket_id1}}',
'{{ticket_id2}}',
'wp-content/plugins/event-tickets/common',
'ver={{COMMON_VERSION}}',
'ver={{ET_VERSION}}',
],
$html
);
Expand Down Expand Up @@ -145,4 +150,4 @@ public function ticket_not_on_sale_should_match_html() {

$this->assertMatchesSnapshot( $html );
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php return '<link rel=\'stylesheet\' id=\'tec-variables-skeleton-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/variables-skeleton.css?ver=6.3.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-skeleton-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/common-skeleton.css?ver=6.3.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tec-variables-full-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/variables-full.css?ver=6.3.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-full-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/common-full.css?ver=6.3.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-paypal-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/paypal.css?ver=5.16.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-responsive-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/common-responsive.css?ver=5.16.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce.css?ver=5.16.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-stripe-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/stripe.css?ver=5.16.0\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-free-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/free.css?ver=5.16.0\' type=\'text/css\' media=\'all\' />
<?php return '<link rel=\'stylesheet\' id=\'tec-variables-skeleton-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/variables-skeleton.css?ver={{COMMON_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-skeleton-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/common-skeleton.css?ver={{COMMON_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tec-variables-full-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/variables-full.css?ver={{COMMON_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-full-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/common/src/resources/css/common-full.css?ver={{COMMON_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-paypal-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/paypal.css?ver={{ET_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-common-responsive-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/common-responsive.css?ver={{ET_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce.css?ver={{ET_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-stripe-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/stripe.css?ver={{ET_VERSION}}\' type=\'text/css\' media=\'all\' />
<link rel=\'stylesheet\' id=\'tribe-tickets-commerce-free-style-css\' href=\'http://wordpress.test/wp-content/plugins/event-tickets/src/resources/css/tickets-commerce/gateway/free.css?ver={{ET_VERSION}}\' type=\'text/css\' media=\'all\' />
<div class="tribe-common event-tickets">
<section
class="tribe-tickets__commerce-checkout"
Expand Down

0 comments on commit 031bb43

Please sign in to comment.