While seeking to use Google Tag 1.x branch and add a new container, I first found that all of the conditions are treated as required right off the bat. I think this is wrong - you should be able to choose which conditions you want to use, or at least have them default to not preventing adding the tag to a page; the current user experience is confusing.
In any case, having sorted that out, we found that the search page of the website was now broken. It reports:
Service unavailable
The website encountered an unexpected error. Please try again later.
TypeError: Drupal\rules\Plugin\Condition\EntityIsNew::doEvaluate(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given in Drupal\rules\Plugin\Condition\EntityIsNew->doEvaluate() (line 37 of modules/contrib/rules/src/Plugin/Condition/EntityIsNew.php).
Drupal\rules\Plugin\Condition\EntityIsNew->doEvaluate(NULL)
call_user_func_array(Array, Array) (Line: 70)
Drupal\rules\Core\RulesConditionBase->evaluate() (Line: 77)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 213)
Drupal\google_tag\ContainerAccessControlHandler->resolveConditions(Array, 'and') (Line: 132)
Drupal\google_tag\ContainerAccessControlHandler->checkAccess(Object, 'view', Object) (Line: 105)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, ) (Line: 314)
Drupal\Core\Entity\EntityBase->access('view') (Line: 404)
Drupal\google_tag\Entity\Container->insertSnippet() (Line: 177)
Drupal\google_tag\Entity\ContainerManager->getScriptAttachments(Array) (Line: 70)
google_tag_page_attachments(Array) (Line: 313)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}(Object, 'google_tag') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('page_attachments', Object) (Line: 314)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 288)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 53)
Drupal\daily_hearing_list\DHLRedirectMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
This is because the EntityIsNew condition is getting used when there is no entity relevant to the search results page. I ended up with the patch I'll attach, which causes the access control handler to ignore conditions that don't apply in the current context.
Please review.
Thanks!