Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
Release 4.1.0
  • Loading branch information
yeniatencio committed Apr 22, 2024
2 parents d0525ae + 70c62b2 commit 543aa9f
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on: push

jobs:
set_status_in_progress:
name: set_status_in_progress
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_build'
description: 'Tide Build running...'
state: 'pending'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
tide_build:
name: tide_build
secrets: inherit
uses: dpc-sdp/github-actions/.github/workflows/tide_build.yml@main
with:
module_build: true
runner: biggy-tide
export_config:
name: export_config
secrets: inherit
uses: dpc-sdp/github-actions/.github/workflows/export_config.yml@main
set_status:
name: set_status
needs: [tide_build]
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_build'
description: 'Tide Build'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
14 changes: 14 additions & 0 deletions .github/workflows/dorg_git_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: dorg_git_sync

on:
push:
branches:
- master
tags:
- '*'

jobs:
dorg_git_sync:
name: dorg_git_sync
uses: dpc-sdp/github-actions/.github/workflows/dorg_git_sync.yml@main
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/merge_to_reference.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: merge_to_reference

on:
push:
branches:
- develop

jobs:
set_status_in_progress:
name: set_status_in_progress
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_merge_to_reference'
description: 'Merge to reference running...'
state: 'pending'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
tide_merge_to_reference:
name: tide_merge_to_reference
uses: dpc-sdp/github-actions/.github/workflows/tide_merge_to_reference.yml@main
set_status:
name: set_status
needs: [tide_merge_to_reference]
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_merge_to_reference'
description: 'Merge to reference running...'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
}
},
"patches": {
"drupal/core": {
"Add a token for publication status - https://www.drupal.org/project/drupal/issues/3073554": "https://www.drupal.org/files/issues/2019-08-09/3073554_10.patch"
},
"drupal/linkit": {
"Unpublished nodes not included even when option is selected - https://www.drupal.org/project/linkit/issues/3049946#comment-14953079": "https://www.drupal.org/files/issues/2023-03-06/linkit-unpublished-nodes-not-included-3049946-32.patch"
}
Expand Down
34 changes: 34 additions & 0 deletions modules/tide_site_simple_sitemap/tide_site_simple_sitemap.module
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Drupal\simple_sitemap\Entity\SimpleSitemap;
use Drupal\simple_sitemap\Entity\SimpleSitemapInterface;
use Drupal\taxonomy\Entity\Term;

/**
* Implements hook_ENTITY_TYPE_delete().
Expand All @@ -29,3 +30,36 @@ function tide_site_simple_sitemap_taxonomy_term_delete($term) {
watchdog_exception('tide_site_simple_sitemap', $exception);
}
}

/**
* Implements hook_ENTITY_TYPE_insert().
*/
function tide_site_simple_sitemap_simple_sitemap_insert(SimpleSitemap $entity) {
$sitemap_id = $entity->id();
if ($term_id = _tide_site_simple_sitemap_extract_site_number($sitemap_id)) {

if (Term::load($term_id) && $entity->getType()->getOriginalId() === 'tide_default_sitemap_type') {
/** @var Drupal\simple_sitemap\Manager\Generator $custom_generator */
$custom_generator = \Drupal::service('simple_sitemap.generator');
$custom_generator->setSitemaps($entity->id());
$site_based_custom_link = $custom_generator->customLinkManager()->get('/');

if (isset($site_based_custom_link[$sitemap_id]) && empty($site_based_custom_link[$sitemap_id])) {
$custom_generator->customLinkManager()->add(
'/',
["path" => "/", "priority" => "1.0", "changefreq" => "daily"]
);
}
}
}
}

/**
* Extract site number from the sitemap id.
*/
function _tide_site_simple_sitemap_extract_site_number($string) {
if (preg_match('/^site-(\d+)$/', $string, $matches)) {
return $matches[1];
}
return NULL;
}

0 comments on commit 543aa9f

Please sign in to comment.