Support from Acquia helps fund testing for Drupal Acquia logo

Comments

willzyx created an issue. See original summary.

willzyx’s picture

Status: Postponed » Active
lussoluca’s picture

Status: Active » Needs review
Issue tags: +DevDaysMilan
FileSize
7.95 KB
willzyx’s picture

Luca good work :)

+++ b/src/Controller/DevelController.php
@@ -88,7 +88,7 @@ class DevelController extends ControllerBase {
-    return array('#markup' => kdevel_print_object($elements_info));
+    return array('#markup' => kpr($elements_info, TRUE));

@@ -100,27 +100,27 @@ class DevelController extends ControllerBase {
-    $output['fields'] = array('#markup' => kprint_r($fields, TRUE, $this->t('Fields')));
+    $output['fields'] = array('#markup' => kpr($fields, TRUE, $this->t('Fields')));
 
     $field_instances = FieldConfig::loadMultiple();
     ksort($field_instances);
-    $output['instances'] = array('#markup' => kprint_r($field_instances, TRUE, $this->t('Instances')));
+    $output['instances'] = array('#markup' => kpr($field_instances, TRUE, $this->t('Instances')));
 
     $bundles = $this->entityManager()->getAllBundleInfo();
     ksort($bundles);
-    $output['bundles'] = array('#markup' => kprint_r($bundles, TRUE, $this->t('Bundles')));
+    $output['bundles'] = array('#markup' => kpr($bundles, TRUE, $this->t('Bundles')));
 
     $field_types = \Drupal::service('plugin.manager.field.field_type')->getUiDefinitions();
     ksort($field_types);
-    $output['field_types'] = array('#markup' => kprint_r($field_types, TRUE, $this->t('Field types')));
+    $output['field_types'] = array('#markup' => kpr($field_types, TRUE, $this->t('Field types')));
 
     $formatter_types = \Drupal::service('plugin.manager.field.formatter')->getDefinitions();
     ksort($formatter_types);
-    $output['formatter_types'] = array('#markup' => kprint_r($formatter_types, TRUE, $this->t('Formatter types')));
+    $output['formatter_types'] = array('#markup' => kpr($formatter_types, TRUE, $this->t('Formatter types')));
 
     $widget_types = \Drupal::service('plugin.manager.field.widget')->getDefinitions();
     ksort($widget_types);
-    $output['widget_types'] = array('#markup' => kprint_r($widget_types, TRUE, $this->t('Widget types')));
+    $output['widget_types'] = array('#markup' => kpr($widget_types, TRUE, $this->t('Widget types')));

@@ -147,7 +147,7 @@ class DevelController extends ControllerBase {
-    return array('#markup' => kprint_r($result, TRUE));
+    return array('#markup' => kpr($result, TRUE));

@@ -200,7 +200,7 @@ class DevelController extends ControllerBase {
-          'data' => kprint_r($state, TRUE),
+          'data' => kpr($state, TRUE),

@@ -245,7 +245,7 @@ class DevelController extends ControllerBase {
-      '#markup' => kprint_r($_SESSION, TRUE),
+      '#markup' => kpr($_SESSION, TRUE),

@@ -276,7 +276,7 @@ class DevelController extends ControllerBase {
-      $output = array('#markup' => kdevel_print_object($entity));
+      $output = array('#markup' => kpr($entity, TRUE));

@@ -311,7 +311,7 @@ class DevelController extends ControllerBase {
-      $output = array('#markup' => kdevel_print_object($build));
+      $output = array('#markup' => kpr($build, TRUE));

Can we inject devel.dumper in DevelController and use ::exportAsRenderable() (where it makes sense) instead of use kpr()? I think it's much cleaner and makes the code more concisely and legibly

willzyx’s picture

A firts step: completely remove kdevel_print_object and its usage

  • willzyx committed 9281f9d on 8.x-1.x
    Issue #2703343 by willzyx, lussoluca: Remove usage of kprint_r() and...
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
willzyx’s picture

Status: Reviewed & tested by the community » Needs work

the patch that removes kprint_r() should take in account #4 and need a reroll :)

willzyx’s picture

Status: Needs work » Needs review
FileSize
6.92 KB
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

  • willzyx committed 815aa54 on 8.x-1.x authored by lussoluca
    Issue #2703343 by willzyx, lussoluca: Remove usage of kprint_r() and...
willzyx’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.