-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[ODSG-45] D10 upgrade
- Loading branch information
Showing
146 changed files
with
17,486 additions
and
16,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
ODSG - Patches | ||
============== | ||
# Patches | ||
|
||
Patches for the Drupal core, libraries, modules and themes. | ||
Information about Drupal patches. | ||
|
||
## Drupal 10 compatibility patches | ||
|
||
Drupal core patches | ||
------------------- | ||
In order to apply the compatibility patches generated by Drupal rector for | ||
example, the https://github.com/orakili/composer-drupal-info-file-patch-helper | ||
needs to be added to the composer.json. | ||
|
||
### Core - core/lib/Drupal/Component/Utility/Xss.php | ||
### Add a new incompatible module | ||
|
||
- `core--drupal--xss-prevent-protocol-stripping-on-datetime-attribute.patch` | ||
1. Add an entry for the module in `extra.drupal-lenient.allowed-list` in the | ||
composer.json file | ||
2. Add the compatibility patch in the `composer.patches.json` file. | ||
3. Require the module via `composer require drupal/module` | ||
|
||
https://www.drupal.org/node/2544110 | ||
Prevent protocol stripping on the [datetime](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time) | ||
attribute as it truncates dates like `2020-01-01T:00:00:00` to `00`... | ||
## Core patches to review | ||
|
||
Review the Drupal 10 compatibility of the following patches: | ||
|
||
- [XSS Filter](https://www.drupal.org/project/drupal/issues/2544110) | ||
- [Pager query parameter](https://www.drupal.org/project/drupal/issues/3143617) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff --git a/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js b/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js | ||
index 1f4ed1d7feb523cffee35f245b7dab06da4f38fa..41449dcf693fab7ff15220fd4b57bd89a71cab8d 100644 | ||
--- a/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js | ||
+++ b/core/modules/ckeditor5/js/ckeditor5.dialog.fix.js | ||
@@ -12,6 +12,12 @@ | ||
// CKEditor 5 in modals can work as expected. | ||
// @see https://api.jqueryui.com/dialog/#method-_allowInteraction | ||
_allowInteraction(event) { | ||
+ // Fixes "Uncaught TypeError: event.target.classList is undefined" | ||
+ // in Firefox (only). | ||
+ // @see https://www.drupal.org/project/drupal/issues/3351600 | ||
+ if (event.target.classList === undefined) { | ||
+ return this._super(event); | ||
+ } | ||
return event.target.classList.contains('ck') || this._super(event); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/core/modules/system/src/Controller/AssetControllerBase.php b/core/modules/system/src/Controller/AssetControllerBase.php | ||
index 620b2ecccf..cce4c397cc 100644 | ||
--- a/core/modules/system/src/Controller/AssetControllerBase.php | ||
+++ b/core/modules/system/src/Controller/AssetControllerBase.php | ||
@@ -191,10 +191,6 @@ public function deliver(Request $request, string $file_name) { | ||
// referenced in cached HTML. | ||
if (hash_equals($generated_hash, $received_hash)) { | ||
$uri = $this->dumper->dumpToUri($data, $this->assetType, $uri); | ||
- $state_key = 'drupal_' . $this->assetType . '_cache_files'; | ||
- $files = $this->state()->get($state_key, []); | ||
- $files[] = $uri; | ||
- $this->state()->set($state_key, $files); | ||
} | ||
return new Response($data, 200, [ | ||
'Cache-control' => static::CACHE_CONTROL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php | ||
index 1e0740fc9d..15f8d4fc9f 100644 | ||
--- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php | ||
+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php | ||
@@ -59,6 +59,20 @@ abstract class QueryPluginBase extends PluginBase implements CacheableDependency | ||
*/ | ||
protected $groupOperator; | ||
|
||
+ /** | ||
+ * WHERE groups. | ||
+ * | ||
+ * @var array | ||
+ */ | ||
+ protected $where; | ||
+ | ||
+ /** | ||
+ * HAVING groups. | ||
+ * | ||
+ * @var array | ||
+ */ | ||
+ protected $having; | ||
+ | ||
/** | ||
* Generate a query and a countquery from all of the information supplied. | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
diff --git a/maintenance200.info.yml b/maintenance200.info.yml | ||
index fa88b4e..9e81116 100755 | ||
--- a/maintenance200.info.yml | ||
+++ b/maintenance200.info.yml | ||
@@ -1,6 +1,5 @@ | ||
name: 'Maintenance 200' | ||
type: module | ||
description: 'Allows the maintenance page to return a configurable HTTP status code rather than the standard 503 code.' | ||
-core: 8.x | ||
-core_version_requirement: ^8 || ^9 | ||
+core_version_requirement: ^9.1 || ^10 | ||
configure: maintenance200_settings | ||
diff --git a/src/EventSubscriber/MaintenanceModeSubscriber.php b/src/EventSubscriber/MaintenanceModeSubscriber.php | ||
index 59c9691..21c58ab 100644 | ||
--- a/src/EventSubscriber/MaintenanceModeSubscriber.php | ||
+++ b/src/EventSubscriber/MaintenanceModeSubscriber.php | ||
@@ -2,21 +2,40 @@ | ||
|
||
namespace Drupal\maintenance200\EventSubscriber; | ||
|
||
+use Symfony\Component\HttpKernel\Event\ResponseEvent; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
-use Symfony\Component\HttpKernel\Event\GetResponseEvent; | ||
use Symfony\Component\HttpKernel\KernelEvents; | ||
-use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | ||
|
||
use Drupal\Core\Site\MaintenanceModeInterface; | ||
use Drupal\Core\Session\AccountInterface; | ||
+use Drupal\Core\Config\ImmutableConfig; | ||
use Drupal\Core\Config\ConfigFactoryInterface; | ||
use Drupal\Core\Routing\RouteMatch; | ||
|
||
- | ||
class MaintenanceModeSubscriber implements EventSubscriberInterface { | ||
|
||
+ /** | ||
+ * Configuration. | ||
+ * | ||
+ * @var \Drupal\Core\Config\ImmutableConfig | ||
+ */ | ||
+ private ImmutableConfig $config; | ||
+ | ||
+ /** | ||
+ * Maintenance mode. | ||
+ * | ||
+ * @var \Drupal\Core\Site\MaintenanceModeInterface | ||
+ */ | ||
+ private MaintenanceModeInterface $maintenanceMode; | ||
+ | ||
+ /** | ||
+ * User account. | ||
+ * | ||
+ * @var \Drupal\Core\Session\AccountInterface | ||
+ */ | ||
+ private AccountInterface $account; | ||
+ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
@@ -30,7 +49,7 @@ class MaintenanceModeSubscriber implements EventSubscriberInterface { | ||
* Respond to RESPONSE Kernel event by setting status code if in maintenance. | ||
* | ||
*/ | ||
- public function onKernelResponse(FilterResponseEvent $event) { | ||
+ public function onKernelResponse(ResponseEvent $event) { | ||
if ($this->config->get('maintenance200_enabled')) { | ||
$status_code = $this->config->get('maintenance200_status_code'); | ||
$request = $event->getRequest(); | ||
diff --git a/tests/src/Functional/Maintenance200SettingsTest.php b/tests/src/Functional/Maintenance200SettingsTest.php | ||
index 044f2f9..1869431 100644 | ||
--- a/tests/src/Functional/Maintenance200SettingsTest.php | ||
+++ b/tests/src/Functional/Maintenance200SettingsTest.php | ||
@@ -20,7 +20,7 @@ class Maintenance200SettingsTest extends BrowserTestBase { | ||
* | ||
* @var array | ||
*/ | ||
- public static $modules = [ | ||
+ protected static $modules = [ | ||
'block', | ||
'maintenance200', | ||
]; | ||
@@ -40,7 +40,7 @@ class Maintenance200SettingsTest extends BrowserTestBase { | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
- protected function setUp() { | ||
+ protected function setUp(): void { | ||
parent::setUp(); | ||
|
||
$this->sut = $this | ||
@@ -57,8 +57,8 @@ class Maintenance200SettingsTest extends BrowserTestBase { | ||
*/ | ||
public function testSettingsForm() { | ||
$this->drupalGet(Url::fromRoute('maintenance200_settings')); | ||
- $this->assertRaw('Change the status code during maintenance mode', 'Checkbox found.'); | ||
- $this->assertFieldByName('maintenance200_enabled', TRUE); | ||
+ $this->assertSession()->responseContains('Change the status code during maintenance mode'); | ||
+ $this->assertSession()->fieldValueEquals('maintenance200_enabled', TRUE); | ||
} | ||
|
||
/** | ||
@@ -68,7 +68,7 @@ class Maintenance200SettingsTest extends BrowserTestBase { | ||
$maintenance200FormUrl = Url::fromRoute('maintenance200_settings') | ||
->toString(); | ||
$this->drupalGet(Url::fromRoute('system.site_maintenance_mode')); | ||
- $this->assertLinkByHref($maintenance200FormUrl); | ||
+ $this->assertSession()->linkByHrefExists($maintenance200FormUrl); | ||
} | ||
|
||
/** | ||
@@ -80,12 +80,13 @@ class Maintenance200SettingsTest extends BrowserTestBase { | ||
$edit = [ | ||
'maintenance200_enabled' => 0, | ||
]; | ||
- $this->drupalPostForm('admin/config/development/maintenance200', $edit, t('Save configuration')); | ||
+ $this->drupalGet('admin/config/development/maintenance200'); | ||
+ $this->submitForm($edit, t('Save configuration')); | ||
|
||
- $this->assertRaw('The configuration options have been saved.', 'Settings saved.'); | ||
+ $this->assertSession()->responseContains('The configuration options have been saved.'); | ||
|
||
$this->drupalGet(Url::fromRoute('maintenance200_settings')); | ||
- $this->assertFieldByName('maintenance200_enabled', FALSE); | ||
+ $this->assertSession()->fieldValueEquals('maintenance200_enabled', FALSE); | ||
} | ||
|
||
} | ||
diff --git a/tests/src/Functional/Maintenance200Test.php b/tests/src/Functional/Maintenance200Test.php | ||
index 8a3d39e..238ea14 100644 | ||
--- a/tests/src/Functional/Maintenance200Test.php | ||
+++ b/tests/src/Functional/Maintenance200Test.php | ||
@@ -19,7 +19,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
* | ||
* @var array | ||
*/ | ||
- public static $modules = [ | ||
+ protected static $modules = [ | ||
'maintenance200', | ||
'node', | ||
]; | ||
@@ -32,7 +32,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
- protected function setUp() { | ||
+ protected function setUp(): void { | ||
parent::setUp(); | ||
|
||
// Create Basic page node type. | ||
@@ -63,7 +63,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
\Drupal::state()->set('system.maintenance_mode', FALSE); | ||
|
||
$this->drupalGet('<front>'); | ||
- $this->assertResponse(200); | ||
+ $this->assertSession()->statusCodeEquals(200); | ||
} | ||
|
||
/** | ||
@@ -81,7 +81,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
->save(); | ||
|
||
$this->drupalGet('<front>'); | ||
- $this->assertResponse(503); | ||
+ $this->assertSession()->statusCodeEquals(503); | ||
} | ||
|
||
/** | ||
@@ -99,7 +99,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
->save(); | ||
|
||
$this->drupalGet('<front>'); | ||
- $this->assertResponse(200); | ||
+ $this->assertSession()->statusCodeEquals(200); | ||
} | ||
|
||
/** | ||
@@ -117,7 +117,7 @@ class Maintenance200Test extends BrowserTestBase { | ||
->save(); | ||
|
||
$this->drupalGet('<front>'); | ||
- $this->assertResponse(418); | ||
+ $this->assertSession()->statusCodeEquals(418); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/src/AliasCleaner.php b/src/AliasCleaner.php | ||
index 20cdb6d..bbd0a7f 100644 | ||
--- a/src/AliasCleaner.php | ||
+++ b/src/AliasCleaner.php | ||
@@ -70,6 +70,13 @@ class AliasCleaner implements AliasCleanerInterface { | ||
*/ | ||
protected $moduleHandler; | ||
|
||
+ /** | ||
+ * List of punctuation characters. | ||
+ * | ||
+ * @var array | ||
+ */ | ||
+ protected $punctuationCharacters; | ||
+ | ||
/** | ||
* Creates a new AliasCleaner. | ||
* |
Oops, something went wrong.