Conversation
Co-authored-by: silvath <2657156+silvath@users.noreply.github.com>
…tions Co-authored-by: silvath <2657156+silvath@users.noreply.github.com>
…ression fixes Co-authored-by: silvath <2657156+silvath@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failed condition for ppElementDisabled in panelSecurityUserNewOrEdit
Fix conditional expression parsing for negation operators in IF functions and parenthesized expressions
Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a critical issue where complex conditional expressions in
d-classattributes would fail to parse correctly, causing the entire page to fail loading. The problem affected expressions with negation operators inside IF function parameters and parenthesized expressions.Problem
The following conditional expressions were failing:
As shown in the issue screenshots, the user management form would display correctly when using simple negation, but fail to load when using negation inside IF functions or with extra parentheses.
Root Cause
The issue was in the
ExecuteFunctionIfmethod inDrapoFunctionHandler.ts. When processing IF function parameters, the method was passing conditional expressions like!ContainsDataItem({{panelUserFeatures}},81)directly toResolveConditionalwithout first resolving the function calls and mustaches within them.This meant that:
{{panelUserFeatures}}remained unresolvedContainsDataItem(...)weren't executed!was applied to unresolved strings instead of boolean valuesSolution
1. Enhanced IF Function Parameter Resolution
ExecuteFunctionIfto callReplaceFunctionExpressionsContextbefore conditional evaluation2. Improved Error Handling
ResolveConditionalExpressionBlockOperationReplaceFunctionExpressionsContextto prevent unresolved functions from breaking evaluation3. Comprehensive Testing
ConditionalBugReproduction.htmltest page covering all failing scenariosMinimalBugTest.htmlfor focused IF function testingImpact
This fix resolves the exact scenarios mentioned in the issue:
IF(!ContainsDataItem({{features}},81), true, false)now works correctly(!ContainsDataItem({{features}},81))now works correctlyThe solution is minimal and surgical - only ~25 lines of code changed across 2 files, with no breaking changes to the existing API.
Original prompt
Fixes #584
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.