AdvancedCustomFields / AdvancedCustomFields/acf

Validation of field number

Open
#928 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Validation of the number field does not work if we use it in a acf gutenberg block. It is about validating the maximum value of the field. Arrows work but I can enter any value and save.

To Reproduce
Steps to reproduce the behavior:

  1. Go to custom acf block with number field that has a set maximum value
  2. Click on number field and enter any value.
  3. Click save
  4. Validation did not catch the error and saved the post.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots or Video
If applicable, add screenshots or video to help explain your problem.

Code
Please drag and drop an export of your field group, option page, custom post type or taxonomy JSON here.
If your issue relates to ACF Blocks, please also provide a reproducable code example of your ACF Block including it's block.json so we can reproduce the issue.

Version Information:

  • WordPress Version 6.6.1
  • PHP Version 8.2
  • ACF VersionACF PRO 6.3.6
  • Browser Chrome 128

Additional context
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in an ACF Gutenberg block with a number field configured with a maximum value, then test saving a value above that limit. The fix is complete when the block's save validation rejects out-of-range values instead of saving the post.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.