Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACF rule set with equal rule doesn't work properly #50

Closed
land0r opened this issue Nov 15, 2022 · 2 comments
Closed

ACF rule set with equal rule doesn't work properly #50

land0r opened this issue Nov 15, 2022 · 2 comments
Assignees
Labels
Bug Something isn't working, looks like a 🐛.
Milestone

Comments

@land0r
Copy link

land0r commented Nov 15, 2022

Description

For numeric ACF values, there is no proper working for the rule set because the condition in PHP is strict - https://github.com/ndiego/block-visibility/blob/main/includes/frontend/visibility-tests/acf.php#L205

If you remove === to == or try to add some type for this check, there will be the desired result.

Step-by-step reproduction instructions

  1. Add any block (paragraph) to Gutenberg.
  2. Add a rule set with ACF. ACF rule is "Show the block if 'Numeric ACF' is equal to 12"
  3. Save the page

Expected behavior

You will see this block because the code tries to compare 12 == '12' (integer with string but without strict comparison)

Actual behavior

You will not see this block because the code tries to compare 12 === '12' (integer with string)

Screenshots or screen recording (optional)

2022-11-15 15 26 58 iq-foundertrac test ef64fe07381e

System information

  • Block Visibility version: 2.4.6
  • Block Visibility Pro version: Not installed
  • WordPress version: 6.1
  • Gutenberg version: "Not installed" as a plugin, used from Core
  • Are all plugins except Block Visibility, Block Visibility Pro (if installed), and Gutenberg (if installed) deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes
@v-vovk
Copy link

v-vovk commented Nov 15, 2022

I totally agree with you, it's a very annoying thing

@ndiego ndiego added the Bug Something isn't working, looks like a 🐛. label Dec 2, 2022
@ndiego ndiego self-assigned this Dec 2, 2022
@ndiego
Copy link
Owner

ndiego commented Dec 2, 2022

@land0r Thanks for reporting this, and I apologize for the delayed reply. This will be fixed in the next version, scheduled for 2022-12-05.

@ndiego ndiego added this to the Version 2.5.0 milestone Dec 2, 2022
@ndiego ndiego closed this as completed in 533eae0 Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working, looks like a 🐛.
Projects
None yet
Development

No branches or pull requests

3 participants