Skip to content

Instantly share code, notes, and snippets.

composer patches plugin with patch command arguments.

@dooug
dooug / generate_list.php
Last active September 11, 2023 19:59
Generate list of pages in Drupal
<?php
/**
* @file gets "path, title" csv format of entries from node, menu_links, menu_router
*
* run from within drupal project root: drush scr generate_list.php
*/
// Bootstrap Drupal
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
/**
* Implements hook_pre_features_revert().
*
* If a menu link is added in a menu handled by this feature, it won't be deleted when the menu feature is reverted.
* Only the menu links exported in the feature will be reverted.
* Implementing this hook allows us to make sure that the menu is fully resetted after the revert
* by first deleting all menu links before reverting.
*/
function main_menu_pre_features_revert($component) {
if($component == 'menu_links') {