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)
CommentFileSizeAuthor
#4 term_condition-3362744.patch968 bytesJFKiwad
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

JFKiwad created an issue. See original summary.

jwilde’s picture

Same problem here.

JFKiwad’s picture

StatusFileSize
new968 bytes

@jwilde, here's a quick patch

nsciacca’s picture

The 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

justcaldwell’s picture

Working on a fix in #3363916: 2.0.2 breaks backward compatibility. This can probably be closed as a duplicate and credit awarded there.

justcaldwell’s picture

justcaldwell’s picture

#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.

astonvictor made their first commit to this issue’s fork.

astonvictor changed the visibility of the branch 2.0.x to hidden.

astonvictor’s picture

Version: 2.0.2 » 2.0.x-dev

astonvictor’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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