Follow-up #2853359: Runtime debug statement in Views now prints out object:

@Lendude:

Printing debug information on a live system feels wrong. Looks like Views is the only place in core where this currently happens outside of tests, so should we maybe take them all out?
\Drupal\views\Plugin\views\field\FieldPluginBase::addAdditionalFields
\Drupal\views\Plugin\views\style\Opml::render
\Drupal\views\Plugin\views\style\Rss::render
\Drupal\views\Plugin\views\style\StylePluginBase::render

@dawehner

This code is probably coming from Drupal 6, where exceptions weren't really a thing, given views was compatible with php 4.

@Lendude

IMO debug statements should not live in core code and as @dawehner pointed out in #11, this is probably a leftover from D6/PHP4 times, so it could do with an update to more current best practice.

Problem/Motivation

debug() has worked its way (for live in core code), and is no longer the best practice.

We have also few other problem with debug:

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 2904847-4.patch3.51 KBmglaman

Comments

Anonymous’s picture

vaplas created an issue. See original summary.

Anonymous’s picture

Issue summary: View changes

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new3.51 KB

Replaces debug() with trigger_error directly.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

I don't see other non-test places where this is used.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 566b7aa and pushed to 8.6.x. Thanks!

  • alexpott committed 566b7aa on 8.6.x
    Issue #2904847 by mglaman, vaplas: Replace debug() statements in Views
    

Status: Fixed » Closed (fixed)

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