I faced this error :
TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in in_array() (line 162 of modules/contrib/term_condition/src/Plugin/Condition/Term.php).
in_array('ff7d00eb-1b88-4f9e-b3b4-a113effbd45e', '297', 1) (Line: 162)
Drupal\term_condition\Plugin\Condition\Term->evaluate() (Line: 77)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 26)
Drupal\block\BlockAccessControlHandler->resolveConditions(Array, 'and') (Line: 116)
Drupal\block\BlockAccessControlHandler->checkAccess(Object, 'view', Object) (Line: 105)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, 1) (Line: 314)
Drupal\Core\Entity\EntityBase->access('view', NULL, 1) (Line: 63)
Drupal\block\BlockRepository->getVisibleBlocksPerRegion(Array) (Line: 137)
Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build() (Line: 274)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 270)
Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 137)
Drupal\shield\ShieldMiddleware->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)
Comments
Comment #3
jwilde commentedSame problem here.
Comment #4
JFKiwad@jwilde, here's a quick patch
Comment #5
nsciaccaThe patch fixes the error from breaking the page, however the functionality is broken. Not sure if they're related but this issue describes the context that's not working: https://www.drupal.org/project/term_condition/issues/3363916
Comment #6
justcaldwellWorking on a fix in #3363916: 2.0.2 breaks backward compatibility. This can probably be closed as a duplicate and credit awarded there.
Comment #7
justcaldwellComment #8
justcaldwell#3363916: 2.0.2 breaks backward compatibility includes changes that ensure term_condition's config is always an array, which should resolve the problem reported here. If you're able, please test/review the fix in that issue to help push it along.
Comment #11
astonvictor commentedComment #14
astonvictor commented