🇮🇳India @TOMY MOHAN

Account created on 31 December 2018, over 5 years ago
#

Recent comments

🇮🇳India TOMY MOHAN

use Drupal\pathauto\PathautoState;
$contentTypes = [ 'library', 'news', 'events'];
foreach ($contentTypes as $contentType) {
$nodeQuery = \Drupal::entityQuery('node');
$nodeQuery->condition('type', $contentType);
$entity_ids = $nodeQuery->execute();
if (isset($entity_ids) && !empty($entity_ids)) {
foreach ($entity_ids AS $entity_id) {
$node = Node::load($entity_id);
$node->path->pathauto = PathautoState::CREATE;
$node->save();
}
}
}

Production build 0.69.0 2024