From 69b7411ccc1940adc1c08c35bbbfbe4400909751 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 13 Jun 2019 12:30:41 -0400 Subject: [PATCH] Civi\Angular\ChangeSet - Relax debug-mode consistency check Overview -------- The Angular subsystem *sometimes* includes a consistency-check. The consistency check ensures that an HTML document is read/written in consistency format (i.e. `encode(decode($html)) === $html`). However, the check is not often run, and it sometimes produces errors on consistency issues which we don't care about. This approach here is to relaxes the checks in `civicrm-core` and reproduce them in separate developer-oriented tooling. Before ------ * If an Angular HTML partial is not altered (`hook_civicrm_alterAngular`), then the partial is *not* checked for consistency. * If a site is in production/non-debug mode, then the partial is *not* checked for consistency. * If a site is in debug mode, then the partial *is* checked for consistency. After ----- * The partial is not checked for consistency. * A task is recorded on the [Afform roadmap](https://github.com/totten/afform/blob/master/docs/roadmap.md) to include better consistency checks in the `afform_auditor` extension. --- Civi/Angular/ChangeSet.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/Civi/Angular/ChangeSet.php b/Civi/Angular/ChangeSet.php index f0eb38148cbf..27c92a5867b1 100644 --- a/Civi/Angular/ChangeSet.php +++ b/Civi/Angular/ChangeSet.php @@ -55,9 +55,6 @@ private static function applyHtmlFilters($changeSets, $strings) { if (preg_match($filter['regex'], $path)) { if ($doc === NULL) { $doc = \phpQuery::newDocument($html, 'text/html'); - if (\CRM_Core_Config::singleton()->debug && !$coder->checkConsistentHtml($html)) { - throw new \CRM_Core_Exception("Cannot process $path: inconsistent markup. Use check-angular.php to investigate."); - } } call_user_func($filter['callback'], $doc, $path); }