From 7a9bf80a89fb5d0758ec35458d585a4050312d73 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 8 May 2020 18:46:31 +0100 Subject: [PATCH] Automatically update the created date for talks Automatically update the created dates for talk nodes so that they match the most-future event. This means that the talks are ordered correctly on the Talks page. --- .idea/codeStyles/Project.xml | 8 ++ bin/run-tests.sh | 14 ++- composer.json | 1 + composer.lock | 104 +++++++++++++++++- config/default/core.extension.yml | 1 + phpstan.neon | 3 + web/modules/custom/custom/custom.info.yml | 4 + web/modules/custom/custom/custom.services.yml | 4 + .../UpdateTalkCreatedDateOnSave.php | 64 +++++++++++ .../Plugin/migrate/destination/OpdTalk.php | 2 + .../field.field.node.talk.field_events.yml | 30 +++++ ...field.field.paragraph.event.field_date.yml | 20 ++++ .../field.storage.node.field_events.yml | 20 ++++ .../field.storage.paragraph.field_date.yml | 19 ++++ .../config/install/node.type.talk.yml | 10 ++ .../paragraphs.paragraphs_type.event.yml | 9 ++ .../modules/custom_test/custom_test.info.yml | 5 + .../src/Kernel/UpdatesTalkCreatedDateTest.php | 100 +++++++++++++++++ 18 files changed, 412 insertions(+), 6 deletions(-) create mode 100644 web/modules/custom/custom/custom.services.yml create mode 100644 web/modules/custom/custom/src/EventSubscriber/UpdateTalkCreatedDateOnSave.php create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/field.field.node.talk.field_events.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/field.field.paragraph.event.field_date.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/field.storage.node.field_events.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/field.storage.paragraph.field_date.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/node.type.talk.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/config/install/paragraphs.paragraphs_type.event.yml create mode 100644 web/modules/custom/custom/tests/modules/custom_test/custom_test.info.yml create mode 100644 web/modules/custom/custom/tests/src/Kernel/UpdatesTalkCreatedDateTest.php diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 4ecddd9..851e78d 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -73,6 +73,14 @@