Skip to content

Commit

Permalink
BSD fixes #312: Add case study path auto since it is ignored.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsqd committed Oct 17, 2024
1 parent ebfc81a commit ce00e4a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions web/modules/custom/case_studies/case_studies.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Install, update and uninstall functions for the Case Studies module.
*/

use Drupal\Core\Config\FileStorage;

/**
* Implements hook_install().
*/
Expand Down Expand Up @@ -46,3 +48,19 @@ function _case_studies_add_case_study_xmlsitemap_entries() {
]);
}
}

/**
* Implements hook_update_n().
*
* Add path alias settings for case studies.
*/
function case_studies_update_8002($is_syncing) {
// Get all configs in the config install dir and install them.
$source = new FileStorage(__DIR__ . '/config/install');
$config_storage = \Drupal::service('config.storage');
foreach ($source->listAll() as $config_name) {
$config_storage->write($config_name, $source->read($config_name));
\Drupal::logger('case_studies')->info('Configuration for @config_name was successfully imported as text.', ['@config_name' => $config_name]);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
langcode: en
status: true
dependencies:
module:
- node
id: case_studies
label: 'Case Studies'
type: 'canonical_entities:node'
pattern: 'our-work/[node:title]'
selection_criteria:
c5da88d6-f0e4-4202-ba8d-c0c5c6ff8a6b:
id: 'entity_bundle:node'
negate: false
uuid: c5da88d6-f0e4-4202-ba8d-c0c5c6ff8a6b
context_mapping:
node: node
bundles:
case_study: case_study
selection_logic: and
weight: -5
relationships: { }

0 comments on commit ce00e4a

Please sign in to comment.