diff --git a/patches/d10-3.json b/patches/d10-3.json index 24b412c31258e12e4ae08bfb58c15a7e185b1a7d..8e4fe171b29d3148893594a4989e15ba7fd36b7b 100644 --- a/patches/d10-3.json +++ b/patches/d10-3.json @@ -23,9 +23,6 @@ "drupal/codesnippet": { "#3021431 Add Yaml as code format": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3021431.diff" }, - "drupal/color_field": { - "#3344907 PHP 8.1": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344907.diff?v=3" - }, "drupal/colorbox": { "#2808883 Responsive image styles": "https://www.drupal.org/files/issues/2024-03-17/colorbox-responsive-image-2808883-69.patch" }, @@ -158,10 +155,6 @@ "drupal/ldap": { "#3227813 Hide password field": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3227813.diff" }, - "drupal/legal": { - "#3251628 Fix destination URL": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3251628.diff", - "#3074688 Password reset links no longer work": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3074688.diff" - }, "drupal/linkchecker": { "#3376854 Base path": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3376854.diff", "#3313343 Disable cron": "https://www.drupal.org/files/issues/2022-10-03/support_disabling_cron-3313343-2.patch" @@ -259,6 +252,9 @@ "drupal/views_tree": { "#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff" }, + "drupal/workflow": { + "#2948377 Do not hide widget when having only one option": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/show-widget-2948377-2.patch" + }, "drupal/wysiwyg_template": { "#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff" }, diff --git a/patches/d10.json b/patches/d10.json index e68cd194037dbc9e7833845de1035dfc097ebe16..009cc0ee92b0e2153b1be1e5b27c2cd6ce7f9173 100644 --- a/patches/d10.json +++ b/patches/d10.json @@ -20,9 +20,6 @@ "drupal/codesnippet": { "#3021431 Add Yaml as code format": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3021431.diff" }, - "drupal/color_field": { - "#3344907 PHP 8.1": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344907.diff?v=3" - }, "drupal/colorbox": { "#2808883 Responsive image styles": "https://www.drupal.org/files/issues/2024-03-17/colorbox-responsive-image-2808883-69.patch" }, @@ -160,10 +157,6 @@ "drupal/ldap": { "#3227813 Hide password field": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3227813.diff" }, - "drupal/legal": { - "#3251628 Fix destination URL": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3251628.diff", - "#3074688 Password reset links no longer work": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3074688.diff" - }, "drupal/linkchecker": { "#3376854 Base path": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3376854.diff", "#3313343 Disable cron": "https://www.drupal.org/files/issues/2022-10-03/support_disabling_cron-3313343-2.patch" @@ -254,6 +247,9 @@ "drupal/views_tree": { "#3344199 Add event just once": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3344199.diff" }, + "drupal/workflow": { + "#2948377 Do not hide widget when having only one option": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/show-widget-2948377-2.patch" + }, "drupal/wysiwyg_template": { "#3354588 Drupal 10 compatible": "https://gitlab.lakedrops.com/composer/plugin/drupal-environment/-/raw/main/patches/d10/3354588.diff" }, diff --git a/patches/d10/3074688.diff b/patches/d10/3074688.diff deleted file mode 100644 index 486327771ba1e5ac15ba01287d3b41f16f818852..0000000000000000000000000000000000000000 --- a/patches/d10/3074688.diff +++ /dev/null @@ -1,104 +0,0 @@ -diff --git a/legal.module b/legal.module -index 87e58d0101cae7f556f4bc3cc21ea7867aaf22b7..d5b16a142b60f519340b28483f78c39d3d3b6aca 100644 ---- a/legal.module -+++ b/legal.module -@@ -489,12 +489,22 @@ function legal_user_login(UserInterface $account) { - - $query = NULL; - $path = \Drupal::request()->getpathInfo(); -- $arg = explode('/', $path); -+ $checkPath = str_replace('dummy/dummy/login', '', Url::fromRoute('user.reset.login', [ -+ 'uid' => $account->id(), -+ 'timestamp' => 'dummy', -+ 'hash' => 'dummy', -+ ])->toString()); - - // One time login link - set user edit page as destination after T&Cs. -- if (isset($arg[1]) && $arg[1] == 'user' && isset($arg[2]) && $arg[2] == 'reset') { -+ if (strpos($path, $checkPath) === 0) { -+ $token = Crypt::randomBytesBase64(55); - $query = [ -- 'destination' => $account->toUrl('edit-form')->toString(), -+ 'destination' => $account->toUrl('edit-form', [ -+ 'query' => ['pass-reset-token' => $token], -+ 'absolute' => FALSE, -+ ], -+ )->toString(), -+ 'pass-reset-token' => $token, - ]; - } - -diff --git a/src/Form/LegalLogin.php b/src/Form/LegalLogin.php -index 9f37ffcfa6de7f9c334ec872615f4a55a3c5a84a..8cbb7d5d582e5e9e4100adde086bc23fc62ebdee 100644 ---- a/src/Form/LegalLogin.php -+++ b/src/Form/LegalLogin.php -@@ -194,6 +194,12 @@ class LegalLogin extends FormBase { - - if (!empty($_GET['destination'])) { - $redirect = $_GET['destination']; -+ if (!empty($_GET['pass-reset-token'])) { -+ // Store password reset token in session for \Drupal\user\AccountForm::form. -+ \Drupal::request()->getSession()->set('pass_reset_' . $user->id(), $_GET['pass-reset-token']); -+ // Clear any flood events for this user. -+ \Drupal::service('flood')->clear('user.password_request_user', $user->id()); -+ } - } - - $form_state->setRedirectUrl(Url::fromUserInput($redirect)); -diff --git a/tests/src/Functional/PasswordResetTest.php b/tests/src/Functional/PasswordResetTest.php -index 85afa9da30cce8b5d66efe7da672486b2fe6a87d..2d78cbf2c0c836df2d67c50b04aac2ad121984c3 100644 ---- a/tests/src/Functional/PasswordResetTest.php -+++ b/tests/src/Functional/PasswordResetTest.php -@@ -17,6 +17,11 @@ class PasswordResetTest extends LegalTestBase { - getMails as drupalGetMails; - } - -+ /** -+ * {@inheritdoc} -+ */ -+ protected $defaultTheme = 'stable'; -+ - /** - * {@inheritdoc} - */ -@@ -25,7 +30,7 @@ class PasswordResetTest extends LegalTestBase { - - // Set the last login time that is used to generate the one-time link so - // that it is definitely over a second ago. -- $this->account->login = \Drupal::time()->getRequestTime() - mt_rand(10, 100000); -+ $this->account->login = \Drupal::time()->getRequestTime() - random_int(10, 100000); - \Drupal::database()->update('users_field_data') - ->fields(['login' => $this->account->getLastLoginTime()]) - ->condition('uid', $this->account->id()) -@@ -35,6 +40,9 @@ class PasswordResetTest extends LegalTestBase { - - /** - * Test loging in with default Legal seetings. -+ * -+ * @throws \Drupal\Core\Entity\EntityMalformedException -+ * @throws \Behat\Mink\Exception\ExpectationException - */ - public function testPasswordReset() { - -@@ -57,8 +65,7 @@ class PasswordResetTest extends LegalTestBase { - - // Check user is redirected to T&C acceptance page. - $expected_query = [ -- 'destination' => $this->account->toUrl('edit-form')->toString(), -- 'token' => '', -+ 'destination' => $this->account->toUrl('edit-form', ['pass-reset-token' => ''])->toString(), - ]; - $expected_url = Url::fromRoute('legal.legal_login', [], ['query' => $expected_query])->setAbsolute()->toString(); - $this->assertStringStartsWith($expected_url, $this->getUrl()); -@@ -74,8 +81,9 @@ class PasswordResetTest extends LegalTestBase { - - // Check user is redirected to their user page. - $current_url = $this->getUrl(); -- $expected_url = $this->baseUrl . '/user/' . $this->uid . '/edit?check_logged_in=1'; -- $this->assertEquals($expected_url, $current_url); -+ $expected_url = $this->baseUrl . '/user/' . $this->uid . '/edit?pass-reset-token='; -+ $this->assertStringStartsWith($expected_url, $current_url); -+ $this->assertStringEndsWith("&check_logged_in=1", $current_url); - } - - } diff --git a/patches/d10/3251628.diff b/patches/d10/3251628.diff deleted file mode 100644 index a0a38ca8cf8689b1235ceefd584922f3d4ae185c..0000000000000000000000000000000000000000 --- a/patches/d10/3251628.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/Form/LegalLogin.php b/src/Form/LegalLogin.php -index 9f37ffcfa6de7f9c334ec872615f4a55a3c5a84a..7955585591147fa3aeff42a17754a0bfaef005b3 100644 ---- a/src/Form/LegalLogin.php -+++ b/src/Form/LegalLogin.php -@@ -196,7 +196,7 @@ class LegalLogin extends FormBase { - $redirect = $_GET['destination']; - } - -- $form_state->setRedirectUrl(Url::fromUserInput($redirect)); -+ $form_state->setRedirectUrl(Url::fromUserInput('/' . $redirect)); - - // Option to require user to accept T&Cs on every login. - if ($config->get('accept_every_login') == '1') { diff --git a/patches/d10/3344907.diff b/patches/d10/3344907.diff deleted file mode 100644 index 7582cb182c9eda1b79e1f0ee474e44c282ae811c..0000000000000000000000000000000000000000 --- a/patches/d10/3344907.diff +++ /dev/null @@ -1,173 +0,0 @@ -diff --git a/color_field.module b/color_field.module -index 89772e653bb58616f538b067b29a4b6220584b15..51f73cbd4b089fcb457e4c9ae85a874629711d22 100644 ---- a/color_field.module -+++ b/color_field.module -@@ -153,7 +153,7 @@ function color_field_tokens(string $type, array $tokens, array $data, array $opt - if ($type === 'color_field' && !empty($data['color_field'])) { - /** @var \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType $color_field */ - $color_field = $data['color_field']; -- $color_hex = new ColorHex($color_field->color, $color_field->opacity); -+ $color_hex = new ColorHex($color_field->color, is_null($color_field->opacity) ? NULL : (float) $color_field->opacity); - - foreach ($tokens as $name => $original) { - switch ($name) { -diff --git a/src/ColorCMY.php b/src/ColorCMY.php -index 51a1d69908c9746f50a001894318e879aad94f7b..133faf181bc5c3168ecb6493c0b6c449fc2d4b43 100644 ---- a/src/ColorCMY.php -+++ b/src/ColorCMY.php -@@ -39,10 +39,10 @@ class ColorCMY extends ColorBase { - * The magenta. - * @param int $yellow - * The yellow. -- * @param float $opacity -+ * @param float|null $opacity - * The opacity. - */ -- public function __construct(int $cyan, int $magenta, int $yellow, float $opacity) { -+ public function __construct(int $cyan, int $magenta, int $yellow, ?float $opacity) { - $this->cyan = $cyan; - $this->magenta = $magenta; - $this->yellow = $yellow; -diff --git a/src/ColorCMYK.php b/src/ColorCMYK.php -index 1f3f00a8ba79ed3694940ff5ee48e23c7e5cc63d..c9163e03d0f400170daf5c683df836dce71c5fd1 100644 ---- a/src/ColorCMYK.php -+++ b/src/ColorCMYK.php -@@ -27,10 +27,10 @@ class ColorCMYK extends ColorCMY { - * The yellow. - * @param int $key - * The key (black). -- * @param float $opacity -+ * @param float|null $opacity - * The opacity. - */ -- public function __construct(int $cyan, int $magenta, int $yellow, int $key, float $opacity) { -+ public function __construct(int $cyan, int $magenta, int $yellow, int $key, ?float $opacity) { - parent::__construct($cyan, $magenta, $yellow, $opacity); - $this->key = $key; - } -diff --git a/src/ColorHSL.php b/src/ColorHSL.php -index 941581ea94d72c5d438266df1ac136274143b7e4..bc5cb32168c435241b7560d394f9513b976d0a1e 100644 ---- a/src/ColorHSL.php -+++ b/src/ColorHSL.php -@@ -39,12 +39,12 @@ class ColorHSL extends ColorBase { - * The sat (0-100) - * @param int $lum - * The lum (0-100) -- * @param float $opacity -+ * @param float|null $opacity - * The opacity. - * - * @throws \Exception - */ -- public function __construct(int $hue, int $sat, int $lum, float $opacity) { -+ public function __construct(int $hue, int $sat, int $lum, ?float $opacity) { - if ($hue < 0 || $hue > 360) { - throw new \Exception("Invalid hue: $hue"); - } -diff --git a/src/ColorHex.php b/src/ColorHex.php -index ebfc3460b6a8c01170f43713f893a861095813ba..8e5a5fd3498c7ba96fd1c86c5195e092d3ee786a 100644 ---- a/src/ColorHex.php -+++ b/src/ColorHex.php -@@ -21,13 +21,13 @@ class ColorHex extends ColorBase { - * - * @param string $color - * The string hex value (i.e. "FFFFFF"). -- * @param string $opacity -+ * @param float|null $opacity - * The opacity value. - * - * @throws \Exception - * If the color doesn't appear to be a valid hex value. - */ -- public function __construct(string $color, ?string $opacity) { -+ public function __construct(string $color, ?float $opacity) { - $color = trim(strtolower($color)); - - if (str_starts_with($color, '#')) { -@@ -45,8 +45,6 @@ class ColorHex extends ColorBase { - $this->color = hexdec($color); - $opacity = $opacity ?? '1'; - $this->setOpacity((float) $opacity); -- -- return $this; - } - - /** -diff --git a/src/ColorRGB.php b/src/ColorRGB.php -index 737a81123eb337890b6616834440a61b9af7a878..248db8eddeae337d8663630eeb86eed4dac2e850 100644 ---- a/src/ColorRGB.php -+++ b/src/ColorRGB.php -@@ -39,10 +39,10 @@ class ColorRGB extends ColorBase { - * The green (0-255) - * @param int $blue - * The blue (0-255) -- * @param float $opacity -+ * @param float|null $opacity - * The opacity. - */ -- public function __construct(int $red, int $green, int $blue, float $opacity) { -+ public function __construct(int $red, int $green, int $blue, ?float $opacity) { - $this->red = max(0, min(255, $red)); - $this->green = max(0, min(255, $green)); - $this->blue = max(0, min(255, $blue)); -diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php -index 8abadb45c37efd0a8d2e9c491be04dcc1758b7ae..bcd26d5905a78a05e5b27e09b36a98b467cefd5a 100644 ---- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php -+++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterCss.php -@@ -309,7 +309,7 @@ class ColorFieldFormatterCss extends FormatterBase implements ContainerFactoryPl - $opacity = $this->getFieldSetting('opacity'); - $settings = $this->getSettings(); - -- $color_hex = new ColorHex($item->color, $item->opacity); -+ $color_hex = new ColorHex($item->color, is_null($item->opacity) ? NULL : (float) $item->opacity); - - return $opacity && $settings['opacity'] - ? $color_hex->toRgb()->toString(TRUE) -diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php -index f1bae9a9557b498dbd255122064a2ee87d3306b3..8392e1ef30cecbfe28e6f87e5dda1f110676b3e9 100644 ---- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php -+++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatch.php -@@ -132,7 +132,7 @@ class ColorFieldFormatterSwatch extends FormatterBase { - continue; - } - -- $color = new ColorHex($item->color, $item->opacity); -+ $color = new ColorHex($item->color, is_null($item->opacity) ? NULL : (float) $item->opacity); - $elements[$delta]['#attributes']['data-color'] = $color->toString(FALSE); - } - -@@ -188,7 +188,7 @@ class ColorFieldFormatterSwatch extends FormatterBase { - $opacity = $this->getFieldSetting('opacity'); - $settings = $this->getSettings(); - -- $color_hex = new ColorHex($item->color, $item->opacity); -+ $color_hex = new ColorHex($item->color, is_null($item->opacity) ? NULL : (float) $item->opacity); - - return $opacity && $settings['opacity'] - ? $color_hex->toRgb()->toString(TRUE) -diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatchOptions.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatchOptions.php -index b9af5fcd22a357c3e4f4a3a2681f73b70558d890..a1ff7d670f955c51c112c5bbd0fd7c52a7e2f2c8 100644 ---- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatchOptions.php -+++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterSwatchOptions.php -@@ -74,7 +74,7 @@ class ColorFieldFormatterSwatchOptions extends ColorFieldFormatterSwatch { - * The color hex value. - */ - protected function viewRawValue(ColorFieldType $item): string { -- return (new ColorHex($item->color, $item->opacity))->toString(FALSE); -+ return (new ColorHex($item->color, is_null($item->opacity) ? NULL : (float) $item->opacity))->toString(FALSE); - } - - } -diff --git a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php -index d9573f328ee9d08d7f6dba821c03c021e5c1497b..5fee14e91cfe3e845478cff456f12d782f8c8507 100644 ---- a/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php -+++ b/src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php -@@ -128,7 +128,7 @@ class ColorFieldFormatterText extends FormatterBase { - $opacity = $this->getFieldSetting('opacity'); - $settings = $this->getSettings(); - -- $color_hex = new ColorHex($item->color, $item->opacity); -+ $color_hex = new ColorHex($item->color, is_null($item->opacity) ? NULL : (float) $item->opacity); - - switch ($settings['format']) { - case 'hex': diff --git a/patches/d10/show-widget-2948377-2.patch b/patches/d10/show-widget-2948377-2.patch new file mode 100644 index 0000000000000000000000000000000000000000..9763a4b37061ccee091e57a9840295d51bc4e790 --- /dev/null +++ b/patches/d10/show-widget-2948377-2.patch @@ -0,0 +1,13 @@ +diff --git a/src/Entity/WorkflowState.php b/src/Entity/WorkflowState.php +index ab9660b..437bc48 100644 +--- a/src/Entity/WorkflowState.php ++++ b/src/Entity/WorkflowState.php +@@ -323,7 +323,7 @@ class WorkflowState extends ConfigEntityBase { + $options = $this->getOptions($entity, $field_name, $account, $force); + $count = count($options); + // The easiest case first: more then one option: always show form. +- if ($count > 1) { ++ if ($count >= 1) { + return TRUE; + } + // #2226451: Even in Creation state, we must have 2 visible states to show the widget. diff --git a/patches/d9.json b/patches/d9.json index 0d32163e03ecd6e6e283ad8d55d1f1a2a46bac32..990c7952cf33790e54f1c5f574d683e7bc9595ef 100644 --- a/patches/d9.json +++ b/patches/d9.json @@ -25,9 +25,6 @@ "drupal/codesnippet": { "#3021431 Add Yaml as code format": "https://git.drupalcode.org/project/codesnippet/-/merge_requests/4.diff" }, - "drupal/color_field": { - "#3344907 PHP 8.1": "https://git.drupalcode.org/project/color_field/-/merge_requests/12.diff?v=3" - }, "drupal/colorbox": { "#2808883 Responsive image styles": "https://www.drupal.org/files/issues/2024-03-17/colorbox-responsive-image-2808883-69.patch" }, @@ -172,9 +169,7 @@ "#3227813 Hide password field": "https://git.drupalcode.org/project/ldap/-/merge_requests/21.diff" }, "drupal/legal": { - "#3251628 Fix destination URL": "https://git.drupalcode.org/project/legal/-/merge_requests/3.diff", - "#3252838 Avoid session_destroy warnings": "https://git.drupalcode.org/project/legal/-/commit/add472c7e449a4fca3e40c7b9ed800c92ecc7cab.diff", - "#3074688 Password reset links no longer work": "https://git.drupalcode.org/project/legal/-/merge_requests/7.diff" + "#3252838 Avoid session_destroy warnings": "https://git.drupalcode.org/project/legal/-/commit/add472c7e449a4fca3e40c7b9ed800c92ecc7cab.diff" }, "drupal/link_attributes": { "#3050455 Array ri string conversion": "https://www.drupal.org/files/issues/2019-04-24/3050455-2.link_attributes.Array-to-string-conversion-in-DrupalCoreTemplateAttributeArraytoString.patch"