Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal 10.4 #858

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ jobs:

- name: Install suggested dependencies
run: |
composer require "league/container:^4.2" "drupal/core-dev:^10.3" --no-update --no-progress --working-dir=/tmp/test/thunder/install
composer require "league/container:^4.2" "drupal/core-dev:^10.4" --no-update --no-progress --working-dir=/tmp/test/thunder/install
composer config allow-plugins.php-http/discovery true --no-plugins --working-dir=/tmp/test/thunder/install

- name: Build the docroot
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"drupal/diff": {
"Back button for comparison page": "https://www.drupal.org/files/issues/back_button_for-2853193-4.patch"
},
"drupal/gin": {
"Issue #3455558: There is no visible change to a toggle when pressed (but it does trigger conditional fields, value is saved, etc)": "https://www.drupal.org/files/issues/2024-08-06/3455558-Refactor-toggle-styles-mr438.patch"
},
"drupal/autosave_form": {
"Issue #3487459: Deprecation error on user edit form": "https://git.drupalcode.org/project/autosave_form/-/merge_requests/19.diff"
},
"drupal/field_group": {
"Drupal 10.4 RC1 error with field_ui.js": "https://git.drupalcode.org/project/field_group/-/merge_requests/88.diff"
}
}
},
Expand All @@ -58,7 +58,7 @@
"drupal/autosave_form": "1.7",
"drupal/blazy": "^2.14",
"drupal/checklistapi": "^2.1",
"drupal/core-recommended": "~10.3.0@stable",
"drupal/core-recommended": "~10.4.0@stable",
"drupal/config_selector": "^2.1",
"drupal/config_update": "^1.7 || ^2.0",
"drupal/content_lock": "^2.1",
Expand All @@ -69,10 +69,10 @@
"drupal/empty_fields": "^1.0-alpha1",
"drupal/entity_reference_actions": "^1.1.1",
"drupal/entity_reference_revisions": "^1.3",
"drupal/field_group": "^3.4",
"drupal/field_group": "3.6",
"drupal/focal_point": "^2.1.2",
"drupal/facets": "^2.0.6",
"drupal/gin": "3.0-rc11",
"drupal/gin": "^3.0-rc15",
"drupal/gin_toolbar": "^1.0-rc6",
"drupal/graphql": "^4.7",
"drupal/inline_entity_form": "^1.0-rc14",
Expand Down
15 changes: 5 additions & 10 deletions modules/thunder_workflow/src/ThunderWorkflowFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public function moveStateToActions(NodeInterface $entity, array $form): array {

if (count($transitions) > 1) {
$form['actions']['submit']['#value'] = $this->t('Save as');
$form['actions']['submit']['#weight'] = 50;
}
elseif (count($transitions) === 1) {
$form['moderation_state']['#attributes']['style'] = 'display: none';
Expand All @@ -198,16 +199,10 @@ public function moveStateToActions(NodeInterface $entity, array $form): array {
['@state' => $transition->to()->label()]);
}

unset($form['moderation_state']['#group']);
$form['moderation_state']['#weight'] = 90;

$form['actions']['moderation_state'] = $form['moderation_state'];
unset($form['moderation_state']);

// Promote moderation_state in gin theme to not end up in
// dropdown button.
$form['actions']['moderation_state']['#gin_action_item'] = TRUE;
$form['actions']['moderation_state']['widget'][0]['#attributes']['form'] = $form['#id'];
// Move to gin_sticky_actions and promote moderation_state in gin theme to
// not end up in dropdown button.
$form['moderation_state']['#group'] = 'gin_sticky_actions';
$form['moderation_state']['widget'][0]['#attributes']['form'] = $form['#id'];

return $form;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/ModeratedContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function testModerationWorkflow(): void {
$this->drupalGet($node->toUrl('edit-form'));

// Test, that hook_form_alter successfully moved moderation_state field.
$this->assertSession()->elementExists('css', '[data-drupal-selector="edit-actions"] > [data-drupal-selector="edit-moderation-state-wrapper"]');
$this->assertSession()->elementExists('css', '[data-drupal-selector="edit-gin-sticky-actions"] > [data-drupal-selector="edit-moderation-state-wrapper"]');

$this->submitForm([
'title[0][value]' => 'Test workflow article in draft 2',
Expand Down
8 changes: 4 additions & 4 deletions tests/src/FunctionalJavascript/MediaImageModifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ public function testRemoveAdd(): void {
/** @var \Drupal\file\FileInterface $file */
$file = $media->get($media->getSource()->getConfiguration()['source_field'])->entity;
$this->assertFileExists($file->getFileUri());
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"] .gin-more-actions__trigger')->click();
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"]')->clickLink('Delete');
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"] .gin-more-actions__trigger')->click();
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"]')->clickLink('Delete');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '#drupal-modal'));
$this->assertSession()->fieldNotExists('also_delete_file');
$this->assertSession()->pageTextContains('This action cannot be undone.The file attached to this media is owned by admin so will be retained.');
Role::load(static::$defaultUserRole)->grantPermission('delete any file')->save();
$this->getSession()->reload();
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"] .gin-more-actions__trigger')->click();
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-actions"]')->clickLink('Delete');
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"] .gin-more-actions__trigger')->click();
$this->getSession()->getPage()->find('css', '[data-drupal-selector="edit-gin-sticky-actions"]')->clickLink('Delete');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '#drupal-modal'));
$this->assertSession()->fieldExists('also_delete_file')->check();
Expand Down
2 changes: 1 addition & 1 deletion tests/src/FunctionalJavascript/ThunderJavascriptTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function assertPageTitle(string $expectedTitle): void {
protected function clickSave(): void {
$driver = $this->getSession()->getDriver();

$driver->click('//div[@data-drupal-selector="edit-actions"]/input[@data-drupal-selector="edit-submit"]');
$driver->click('//div[@data-drupal-selector="edit-gin-sticky-actions"]/input[@data-drupal-selector="gin-sticky-edit-submit"]');
}

}
4 changes: 2 additions & 2 deletions thunder.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Thunder
type: profile
description: 'The Drupal based CMS for professional publishing.'
project: thunder
core_version_requirement: ~10.3.0
version: '7.3.9'
core_version_requirement: ~10.4.0
version: '7.4.0'

distribution:
name: Thunder
Expand Down