Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / node / tests / modules / node_test / node_test.module
index c852b441102b94156fa0122218fcaffa6c27f5c1..56aef63c618e81fdd9cb14369b0a5ffeda13dfc5 100644 (file)
@@ -14,7 +14,6 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\node\NodeInterface;
 
-
 /**
  * Implements hook_ENTITY_TYPE_view() for node entities.
  */
@@ -156,7 +155,7 @@ function node_test_node_update(NodeInterface $node) {
  */
 function node_test_entity_view_mode_alter(&$view_mode, EntityInterface $entity, $context) {
   // Only alter the view mode if we are on the test callback.
-  $change_view_mode = \Drupal::state()->get( 'node_test_change_view_mode') ?: '';
+  $change_view_mode = \Drupal::state()->get('node_test_change_view_mode') ?: '';
   if ($change_view_mode) {
     $view_mode = $change_view_mode;
   }
@@ -183,10 +182,10 @@ function node_test_node_insert(NodeInterface $node) {
  */
 function node_test_form_alter(&$form, FormStateInterface $form_state, $form_id) {
   if (!$form_state->get('node_test_form_alter')) {
-    drupal_set_message('Storage is not set');
+    \Drupal::messenger()->addStatus('Storage is not set');
     $form_state->set('node_test_form_alter', TRUE);
   }
   else {
-    drupal_set_message('Storage is set');
+    \Drupal::messenger()->addStatus('Storage is set');
   }
 }