Unverified Commit 3ac9df13 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2002514 by dawehner, mondrake, damiankloip, RobLoach, ParisLiakos,...

Issue #2002514 by dawehner, mondrake, damiankloip, RobLoach, ParisLiakos, joachim, Krzysztof Domański, gaurav.kapoor, chx, alexpott, tim.plunkett, Mile23, daffie: Deprecate debug(); remove references to _drupal_debug_message()
parent 08350aec
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ function _drupal_flush_css_js() {
 * Outputs debug information.
 *
 * The debug information is passed on to trigger_error() after being converted
 * to a string using _drupal_debug_message().
 * to a string using print_r() or var_export().
 *
 * @param $data
 *   Data to be output.
@@ -611,8 +611,14 @@ function _drupal_flush_css_js() {
 *   Flag to switch between print_r() and var_export() for data conversion to
 *   string. Set $print_r to FALSE to use var_export() instead of print_r().
 *   Passing recursive data structures to var_export() will generate an error.
 *
 * @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use dump()
 *   instead.
 *
 * @see https://www.drupal.org/node/3192283
 */
function debug($data, $label = NULL, $print_r = TRUE) {
  @trigger_error('debug() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use dump() instead. See https://www.drupal.org/node/3192283', E_USER_DEPRECATED);
  // Print $data contents to string.
  $string = Html::escape($print_r ? print_r($data, TRUE) : var_export($data, TRUE));

+0 −1
Original line number Diff line number Diff line
@@ -217,7 +217,6 @@ function _drupal_log_error($error, $fatal = FALSE) {

      // If error type is 'User notice' then treat it as debug information
      // instead of an error message.
      // @see debug()
      if ($error['%type'] == 'User notice') {
        $error['%type'] = 'Debug';
        $class = 'status';
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ public function onException(ExceptionEvent $event) {
    if ($this->isErrorDisplayable($error)) {
      // If error type is 'User notice' then treat it as debug information
      // instead of an error message.
      // @see debug()
      if ($error['%type'] == 'User notice') {
        $error['%type'] = 'Debug';
      }
+0 −8
Original line number Diff line number Diff line
@@ -670,18 +670,10 @@ protected function verifyRenderCache($cid, array $tags, $redirected_cid = NULL)
    $is_redirecting_cache_item = isset($cache_entry->data['#cache_redirect']);
    if ($redirected_cid === NULL) {
      $this->assertFalse($is_redirecting_cache_item, 'Render cache entry is not a redirect.');
      // If this is a redirecting cache item unlike we expected, log it.
      if ($is_redirecting_cache_item) {
        debug($cache_entry->data);
      }
    }
    else {
      // Verify that $cid contains a cache redirect.
      $this->assertTrue($is_redirecting_cache_item, 'Render cache entry is a redirect.');
      // If this is not a redirecting cache item unlike we expected, log it.
      if (!$is_redirecting_cache_item) {
        debug($cache_entry->data);
      }
      // Verify that the cache redirect points to the expected CID.
      $redirect_cache_metadata = $cache_entry->data['#cache'];
      $actual_redirection_cid = $this->createCacheId(
+2 −2
Original line number Diff line number Diff line
@@ -1060,7 +1060,7 @@ function hook_views_plugins_exposed_form_alter(array &$plugins) {
 */
function hook_views_plugins_join_alter(array &$plugins) {
  // Print out all join plugin names for debugging purposes.
  debug($plugins);
  dump($plugins);
}

/**
@@ -1092,7 +1092,7 @@ function hook_views_plugins_pager_alter(array &$plugins) {
 */
function hook_views_plugins_query_alter(array &$plugins) {
  // Print out all query plugin names for debugging purposes.
  debug($plugins);
  dump($plugins);
}

/**
Loading