Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 11.4.3 #122

Open
wants to merge 5 commits into
base: 11.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion engineering_profile.info.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "SOE Profile"
description: 'Jumpstart Website Profile'
version: 11.4.1
version: 11.4.3
type: profile
project: Stanford
core_version_requirement: ^9 || ^10
Expand Down
9 changes: 8 additions & 1 deletion modules/engineering_profile_helper/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"type": "drupal-module",
"description": "Engineering Profile Helper module",
"keywords": [],
"minimum-stability": "dev"
"minimum-stability": "dev",
"extra": {
"drush": {
"services": {
"drush.services.yml": "^9"
}
}
}
}
5 changes: 5 additions & 0 deletions modules/engineering_profile_helper/drush.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
my_module.commands:
class: Drupal\engineering_profile_helper\Commands\EngineeringProfileHelperCommands
tags:
- { name: drush.command }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\redirect\Entity\Redirect;
use Drupal\pathauto\PathautoState;

/**
* Fix broken manual redirect loops.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Profile magazine_navigation_block
<button aria-label="Open the Topics menu" id="magazine-landing-nav__topics-toggle" aria-expanded="false"></button>
</div>

<div class="news-navigation-nav__item foe_item"><a href="/news/collection/future-everything-podcast" aria-label="Future of Everything podcast">Future of Everything</a></div>
<div class="news-navigation-nav__item foe_item"><a href="/news/collection/future-everything-podcast" aria-label="The Future of Everything podcast">The Future of Everything</a></div>

<div class="news-navigation-nav__item spotlight_item"><a href="/spotlight" aria-label="Spotlights">Spotlights</a></div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace Drupal\engineering_profile_helper\Commands;

use Drush\Commands\DrushCommands;
use Drupal\node\Entity\Node;
use Drupal\taxonomy\Entity\Term;
use Drupal\pathauto\PathautoState;

/**
* A Drush command file.
*/
class EngineeringProfileHelperCommands extends DrushCommands {

/**
* Updates URL alias settings for specific nodes and taxonomy terms.
*
* @command engineering-profile-helper:update-url-aliases
* @aliases eph-update-aliases
* @description Updates URL alias settings for stanford_page, spotlight, and stanford_news nodes that were not set to generate automatically.
*/
public function updateUrlAliases() {
$entity_type = 'node';
$entity_storage = \Drupal::entityTypeManager()->getStorage($entity_type);
$nodes = $entity_storage->loadMultiple();
foreach ($nodes as $node) {
$bundles = ['stanford_page', 'stanford_news', 'spotlight'];
if (in_array($node->bundle(), $bundles) && !$node->path->pathauto) {
$node->path->pathauto = PathautoState::CREATE;
$node->save();
}
}

$entity_type = 'taxonomy_term';
$entity_storage = \Drupal::entityTypeManager()->getStorage($entity_type);
$terms = $entity_storage->loadMultiple();
foreach ($terms as $term) {
if (!$term->path->pathauto) {
$term->path->pathauto = PathautoState::CREATE;
$term->save();
}
}

$this->logger()->success('Updated URL alias settings for stanford_page, spotlight, and stanford_news nodes and all taxonomy terms that were not set to generate automatically.');
}

}
Loading