Problem/Motivation

Using the current dev version, the check to determine if the user status options are set is inadequate. Currently, if no user status options are set the code meant to prevent processing of options of the user status condition incorrectly identifies options as having been set and eventually returns false, meaning most blocks will fail to display.

Steps to reproduce

Add block to region before enabling module.
Enable Context.
Edit block settings, but don't change anything, just save.

Block no longer displays.

Proposed resolution

Editing the block settings sets all the values in the user status options to 0, but the check in the code meant to prevent hiding blocks if this section isn't filled in is using empty(). The array of options isn't empty, it has four variables set to 0.

I'll attach a patch that adds an additional check to see if all options are set to 0, and if so, returns true right away.

Comments

jmickela created an issue. See original summary.

jmickela’s picture

This check fixes the issue

willemviljoen’s picture

Experiencing the same issue using Context 8.x-4.0 on Drupal 9.2.2.
Patch #2 seems to fix the issue, could not pick up any issues after patching so far.

paulocs’s picture

Thanks!

  • paulocs committed 7d205a7 on 8.x-4.x authored by jmickela
    Issue #3225763 by jmickela, willemviljoen, paulocs: Global blocks placed...
paulocs’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

ecj’s picture

Big problem fixed here. After this no issues anymore. Thanks.