Skip to content

Fix fatal TypeError when dynamic tag returns array (ACF gallery / rep… - #35

Open
cgdmohamed wants to merge 1 commit into
proelements:masterfrom
cgdmohamed:fix/display-condition-array-values
Open

cgdmohamed wants to merge 1 commit into
proelements:masterfrom
cgdmohamed:fix/display-condition-array-values

Conversation

@cgdmohamed

Copy link
Copy Markdown

Issue

Display condition string comparators strictly type-hint $actual_value as string.

However many dynamic sources in real Elementor usage (e.g. ACF Gallery,
Repeater, Relationship, multi-select taxonomies) return array values.

On PHP 8+, this causes a fatal TypeError before comparator logic executes,
breaking frontend rendering when using conditions like "is not empty".

Fix

  • Allow $actual_value to accept non-scalar values.
  • Add native handling for array values:
    • evaluate IS_EMPTY / IS_NOT_EMPTY directly
    • normalize arrays to string for other string comparators.

Result

  • Prevents fatal crashes
  • Improves compatibility with ACF ecosystem
  • Maintains backward compatibility for scalar values

@BackuPs

BackuPs commented Mar 15, 2026

Copy link
Copy Markdown

Report this to the official Elementor repo. The author of this plugin will not accept any changes to the plugin as it is a one on one copy of the original elementor pro.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants