From 0bf9a4a056ab4844b713d3e1b8504df2940c2d9e Mon Sep 17 00:00:00 2001 From: Johan Gant Date: Fri, 27 Sep 2019 14:41:14 +0100 Subject: [PATCH 1/3] Flush development to master (#14) * bug fix to audit processing * Update README.md --- README.md | 8 ++++++++ origins_workflow/origins_workflow.module | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 282cfa7a..cedff6f1 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,11 @@ A collection of modules for use across DOF-DSS Drupal sites * **origins_common:** General utilities and functions. * **origins_layouts:** A collection of Layout Builder layouts. * **origins_workflow:** Generic editorial workflows across DoF sites. + +## Usage + +You can include this package into your project using composer: +``` +composer require dof-dss/nicsdru_origins_modules +``` +Details can be found at: https://packagist.org/packages/dof-dss/nicsdru_origins_modules diff --git a/origins_workflow/origins_workflow.module b/origins_workflow/origins_workflow.module index 0005cc12..fa34fee2 100644 --- a/origins_workflow/origins_workflow.module +++ b/origins_workflow/origins_workflow.module @@ -28,7 +28,7 @@ function origins_workflow_entity_presave(EntityInterface $entity) { if ($entity->getEntityTypeId() == 'node') { if (isset($audit_types[$entity->bundle()]) && ($audit_types[$entity->bundle()] == $entity->bundle())) { // We have just published a node type that is subject to auditing. - if ($entity->isPublished()) { + if ($entity->isPublished() && $entity->hasField('field_next_audit_due')) { $next_audit_date = $entity->get('field_next_audit_due')->value; if (empty($next_audit_date)) { // No audit date set, set it for six months time. From cdb6535fce6e261e4ba16ae4bca92408b4b9d2a9 Mon Sep 17 00:00:00 2001 From: Johan Gant Date: Fri, 9 Oct 2020 11:25:36 +0100 Subject: [PATCH 2/3] 0.9.3 release (#103) * Add timestamp to node title to avoid tripping the unique title validation (#99) * D8NID-897 ~ Use CSS selector instead of field to generate ToC * D8NID-897 ~ Replace hard coded values with configuration * D8NID-897 ~ Remove warning notice * D8NID-897 ~ Remove source field exists check * D8NID-897 ~ Perform some ToC enabled checks earlier for perf reasons * D8NID-897 ~ Update comments * Fix stable packages on coder module (#101) * bug fix - duplicate revision numbers being shown if diff module not installed Co-authored-by: omahm Co-authored-by: Steve Cousins Co-authored-by: DuttonMa --- .circleci/config.yml | 2 +- origins_toc/js/origins_toc.js | 31 +++++++++---------- origins_toc/origins_toc.module | 17 ++++------ origins_workflow/origins_workflow.module | 16 +++++++--- .../02.draftToNeedsReview.js | 2 +- .../03.draftToQuickPublish.js | 2 +- .../04.needsReviewToPublished.js | 2 +- .../05.needsReviewToReject.js | 2 +- .../06.publishedToArchive.js | 2 +- .../07.publishedToDraftOfPublished.js | 2 +- .../08.publishedToUnpublished.js | 2 +- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9836219a..7878f91e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ jobs: - run: name: Fetch phpcs and dependencies command: | - composer require drupal/coder --no-interaction --optimize-autoloader + composer require drupal/coder --prefer-stable --no-interaction --optimize-autoloader # Move vendor directory up a level as we don't want to code-check all of that. mv vendor ../ - run: diff --git a/origins_toc/js/origins_toc.js b/origins_toc/js/origins_toc.js index 31a0ab40..9bac9ac0 100644 --- a/origins_toc/js/origins_toc.js +++ b/origins_toc/js/origins_toc.js @@ -3,25 +3,23 @@ Drupal.behaviors.originsToC = { attach: function attach (context) { - var tocHeadings = $('#main-article h2', context).once('attachToC'); - if (tocHeadings.length > 2) { + if (typeof drupalSettings.origins_toc.settings !== 'undefined') { + var toc_settings = drupalSettings.origins_toc.settings; + } else { + return; + } - if (typeof drupalSettings.origins_toc.settings !== 'undefined') { - var toc_settings = drupalSettings.origins_toc.settings; - } else { - return; - } + // Check if Toc is enabled for this entity type and this entity instance. + if (toc_settings.toc_enable != 1 || toc_settings.toc_entity_enable != 1) { + return; + } - // Check if Toc is enabled for this entity type and this entity. - if (toc_settings.toc_enable != 1 || toc_settings.toc_entity_enable != 1) { - return; - } + var tocHeadings = $(toc_settings.toc_source_container + ' ' + toc_settings.toc_element, context).once('attachToC'); - // This implementation doesn't use the configuration - // from the toc 3rd party settings 'toc_settings'. - let tocHeadings = $('#main-article h2').not('toc--exclude'); + if (tocHeadings.length > 2) { + let tocHeadings = $(toc_settings.toc_source_container + ' ' + toc_settings.toc_element).not(toc_settings.toc_exclusions); let $tocList = $('