Skip to content
Snippets Groups Projects

Update frontend_routing.module

1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -10,6 +10,7 @@
@@ -10,6 +10,7 @@
*/
*/
function frontend_routing_form_node_form_alter(&$form, &$form_state) {
function frontend_routing_form_node_form_alter(&$form, &$form_state) {
$nodes = \Drupal::state()->get('frontend_routing.settings');
$nodes = \Drupal::state()->get('frontend_routing.settings');
 
if (is_array($nodes) && !empty($nodes)) {
$nodes = array_combine($nodes, $nodes);
$nodes = array_combine($nodes, $nodes);
$node = $form_state->getFormObject()->getEntity();
$node = $form_state->getFormObject()->getEntity();
if (!$node->isNew() && in_array($node->id(), $nodes)) {
if (!$node->isNew() && in_array($node->id(), $nodes)) {
@@ -17,4 +18,5 @@ function frontend_routing_form_node_form_alter(&$form, &$form_state) {
@@ -17,4 +18,5 @@ function frontend_routing_form_node_form_alter(&$form, &$form_state) {
$form['path_replace']['#weight'] = $form['path']['#weight'];
$form['path_replace']['#weight'] = $form['path']['#weight'];
$form['path_replace']['#markup'] = '<strong>' . t('This node is managed by Frontend Routing.') . '</strong>';
$form['path_replace']['#markup'] = '<strong>' . t('This node is managed by Frontend Routing.') . '</strong>';
}
}
 
}
}
}
Loading