diff --git a/composer.json b/composer.json index 548d2bee..93c0341b 100644 --- a/composer.json +++ b/composer.json @@ -112,7 +112,7 @@ "drupal/name": "^1.0@RC", "drupal/next": "^1.2", "drupal/nobots": "^1.0", - "drupal/node_revision_delete": "^1.0@RC", + "drupal/node_revision_delete": "^2.0@RC", "drupal/page_cache_query_ignore": "^2.2", "drupal/page_manager": "^4.0@beta", "drupal/paragraphs": "^1.11", @@ -141,7 +141,7 @@ "drupal/view_unpublished": "^1.0", "drupal/viewfield": "^3.0@beta", "drupal/views_block_filter_block": "^2.0@beta", - "drupal/views_bulk_edit": "^2.6", + "drupal/views_bulk_edit": "^3.0", "drupal/views_contextual_filters_or": "^1.3", "drupal/views_custom_cache_tag": "^1.2", "drupal/views_infinite_scroll": "^2.0", diff --git a/config/sync/node.type.stanford_event.yml b/config/sync/node.type.stanford_event.yml index c714061f..d1855d04 100644 --- a/config/sync/node.type.stanford_event.yml +++ b/config/sync/node.type.stanford_event.yml @@ -11,9 +11,10 @@ third_party_settings: available_menus: { } parent: '' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_event_series.yml b/config/sync/node.type.stanford_event_series.yml index bafb6d20..ce393e36 100644 --- a/config/sync/node.type.stanford_event_series.yml +++ b/config/sync/node.type.stanford_event_series.yml @@ -12,9 +12,10 @@ third_party_settings: - main parent: 'main:' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_news.yml b/config/sync/node.type.stanford_news.yml index 693e14f0..592670ca 100644 --- a/config/sync/node.type.stanford_news.yml +++ b/config/sync/node.type.stanford_news.yml @@ -11,9 +11,10 @@ third_party_settings: available_menus: { } parent: '' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_opportunity.yml b/config/sync/node.type.stanford_opportunity.yml index f71e2057..34806b8a 100644 --- a/config/sync/node.type.stanford_opportunity.yml +++ b/config/sync/node.type.stanford_opportunity.yml @@ -12,9 +12,10 @@ third_party_settings: - main parent: 'main:' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_page.yml b/config/sync/node.type.stanford_page.yml index 7c1425e9..2a1fbe11 100644 --- a/config/sync/node.type.stanford_page.yml +++ b/config/sync/node.type.stanford_page.yml @@ -12,9 +12,10 @@ third_party_settings: - main parent: 'main:' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_person.yml b/config/sync/node.type.stanford_person.yml index 9c5d4da6..c3ef3e0d 100644 --- a/config/sync/node.type.stanford_person.yml +++ b/config/sync/node.type.stanford_person.yml @@ -13,9 +13,10 @@ third_party_settings: - stanford-person-type parent: 'main:' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node.type.stanford_publication.yml b/config/sync/node.type.stanford_publication.yml index 8c5308d7..1fd12288 100644 --- a/config/sync/node.type.stanford_publication.yml +++ b/config/sync/node.type.stanford_publication.yml @@ -11,9 +11,10 @@ third_party_settings: available_menus: { } parent: '' node_revision_delete: - minimum_revisions_to_keep: 5 - minimum_age_to_delete: 0 - when_to_delete: 0 + amount: + status: true + settings: + amount: 5 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab diff --git a/config/sync/node_revision_delete.settings.yml b/config/sync/node_revision_delete.settings.yml index 59a222b9..4378ffee 100644 --- a/config/sync/node_revision_delete.settings.yml +++ b/config/sync/node_revision_delete.settings.yml @@ -1,11 +1 @@ -_core: - default_config_hash: Pxmt-VsuXAuxxpRjBCrKQOxetjgmBAE2DfSD7s276UM -delete_newer: false -node_revision_delete_cron: 50 -node_revision_delete_time: 0 -node_revision_delete_minimum_age_to_delete_time: - max_number: 6 - time: months -node_revision_delete_when_to_delete_time: - max_number: 6 - time: months +disable_automatic_queueing: false diff --git a/config/sync/ultimate_cron.job.node_revision_delete_cron.yml b/config/sync/ultimate_cron.job.node_revision_delete_cron.yml deleted file mode 100644 index 3389ff34..00000000 --- a/config/sync/ultimate_cron.job.node_revision_delete_cron.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: c4004a13-4474-4317-b03e-2ce357501e87 -langcode: en -status: true -dependencies: - module: - - node_revision_delete -title: 'Default cron handler' -id: node_revision_delete_cron -weight: 0 -module: node_revision_delete -callback: node_revision_delete_cron -scheduler: - id: simple - configuration: - rules: - - '* * * * *' -launcher: - id: serial -logger: - id: database diff --git a/tests/codeception/acceptance/AuthenticatedPermissionsCest.php b/tests/codeception/acceptance/AuthenticatedPermissionsCest.php index 66f598bb..ec174482 100644 --- a/tests/codeception/acceptance/AuthenticatedPermissionsCest.php +++ b/tests/codeception/acceptance/AuthenticatedPermissionsCest.php @@ -80,12 +80,8 @@ public function testAuthenticatedUserRestrictions(AcceptanceTester $I) { */ public function testSiteManagerEscalationSelf(AcceptanceTester $I) { $site_manager = $I->logInWithRole('site_manager'); - $site_manager_id = $site_manager->id(); - $I->amOnPage('/admin/users'); - $I->canSee($site_manager->getDisplayName()); - $I->click(['link' => $site_manager->getDisplayName()]); - $I->click('.roles.tabs__tab a'); - $I->canSeeInCurrentUrl("/user/$site_manager_id/roles"); + $I->amOnPage($site_manager->toUrl('edit-form')->toString()); + $I->dontSee('Administrator'); $I->dontSee('Site Builder'); $I->dontSee('Site Developer'); @@ -95,11 +91,11 @@ public function testSiteManagerEscalationSelf(AcceptanceTester $I) { * Site Manager cannot escalate others' role above Site Manager. */ public function testSiteManagerEscalationOthers(AcceptanceTester $I) { + $name = $this->faker->words(3, TRUE); + $user = $I->createEntity(['name' => $name], 'user'); $I->logInWithRole('site_manager'); - $I->amOnPage('/admin/users'); - $I->canSee('Morgan'); - $I->click('Morgan'); - $I->click('.roles.tabs__tab a'); + $I->amOnPage($user->toUrl('edit-form')->toString()); + $I->canSeeInField('Username', $name); $I->dontSee('Administrator'); $I->dontSee('Site Builder'); $I->dontSee('Site Developer'); diff --git a/tests/codeception/acceptance/Content/NewsCest.php b/tests/codeception/acceptance/Content/NewsCest.php index e0d8f05d..d3803f75 100644 --- a/tests/codeception/acceptance/Content/NewsCest.php +++ b/tests/codeception/acceptance/Content/NewsCest.php @@ -126,9 +126,8 @@ public function testXMLMetaDataRevisions(AcceptanceTester $I) { // Revision Delete is enabled. $I->amOnPage('/admin/structure/types/manage/stanford_news'); - $I->seeCheckboxIsChecked("#edit-node-revision-delete-track"); - $I->seeCheckboxIsChecked("#edit-options-revision"); - $I->seeInField("#edit-minimum-revisions-to-keep", 5); + $I->seeCheckboxIsChecked("#edit-amount-status"); + $I->seeInField("Minimum number of revisions to keep (per language)", 5); // XML Sitemap. $I->amOnPage("/admin/config/search/xmlsitemap/settings"); diff --git a/tests/codeception/acceptance/Content/PersonCest.php b/tests/codeception/acceptance/Content/PersonCest.php index c332eb54..15b653d1 100644 --- a/tests/codeception/acceptance/Content/PersonCest.php +++ b/tests/codeception/acceptance/Content/PersonCest.php @@ -96,9 +96,8 @@ public function testXMLMetaDataRevisions(AcceptanceTester $I) { // Revision Delete is enabled. $I->amOnPage('/admin/structure/types/manage/stanford_person'); - $I->seeCheckboxIsChecked('#edit-node-revision-delete-track'); - $I->seeCheckboxIsChecked('#edit-options-revision'); - $I->seeInField('#edit-minimum-revisions-to-keep', 5); + $I->seeCheckboxIsChecked("#edit-amount-status"); + $I->seeInField("Minimum number of revisions to keep (per language)", 5); // XML Sitemap. $I->amOnPage('/admin/config/search/xmlsitemap/settings'); diff --git a/tests/codeception/acceptance/Contrib/NodeRevisionDeleteCest.php b/tests/codeception/acceptance/Contrib/NodeRevisionDeleteCest.php index 52f43aea..cf35ae76 100644 --- a/tests/codeception/acceptance/Contrib/NodeRevisionDeleteCest.php +++ b/tests/codeception/acceptance/Contrib/NodeRevisionDeleteCest.php @@ -44,7 +44,7 @@ public function testNodeRevisionDelete(AcceptanceTester $I) { $I->amOnPage("/node/{$node->id()}/revisions"); $I->canSeeNumberOfElements('.diff-revisions tbody tr', 11); - $I->runDrush('cron:run node_revision_delete_cron --force'); + $I->runDrush('queue:run node_revision_delete'); $I->amOnPage("/node/{$node->id()}/revisions"); $I->canSeeNumberOfElements('.diff-revisions tbody tr', 5); }