diff --git a/node_clone.module b/node_clone.module index d899daf..1f1a2a9 100644 --- a/node_clone.module +++ b/node_clone.module @@ -42,7 +42,7 @@ function node_clone_action_link_title($node) { return t('Clone'); } if (\Drupal::config('node_clone.settings')->get('node_clone_use_node_type_name')) { - return t('Clone this !type', array('!type' => \Drupal\Component\Utility\Unicode::strtolower(node_type_get_name($node)))); + return t('Clone this !type', array('!type' => mb_strtolower(node_type_get_name($node)))); } return t('Clone content'); } @@ -109,7 +109,7 @@ function node_clone_form_node_admin_content_alter(&$form, $form_state, $form_id) } // Expose a Clone operation on each node. foreach ($form['admin']['nodes'][$property] as $nid => &$row) { - $node = \Drupal::entityManager()->getStorage('node')->load($nid); + $node = \Drupal::entityTypeManager()->getStorage('node')->load($nid); if (node_clone_access_cloning($node)) { // The structure of this form is different if there is just 1 or more // than one operation. @@ -192,7 +192,7 @@ function node_clone_action_clone($original_node, $context) { } } else { - drupal_set_message(t('Clone failed for %title : not permitted for nodes of type %type', array('%title' => $original_node->title, '%type' => $original_node->type)), 'warning'); + $this->messenger()->addMessage(t('Clone failed for %title : not permitted for nodes of type %type', array('%title' => $original_node->title, '%type' => $original_node->type)), 'warning'); } }