AdvancedCustomFields / AdvancedCustomFields/acf

ACF 5.8.0-beta4: Conditionally hidden empty field gets non empty 0 value after save and reload

Open
#155 6 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

The case:

I have 2 simple text fields within a block. The second is hidden if the first is not empty (conditional logic).

The issue:

When I fill the first field (the second disappears), save the page and reload, then, after removing input from the first field and revealing the second one it occurs that the second field displays 0 instead of nothing.

It leads to many problems; for example, I spotted this issue when I had further conditional logic built upon the second field emptiness, failing with 0 value inside...

Related?

It may be related to #147 but I am not sure.

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

Reproduce the described sequence: hide the second text field, save and reload, then clear the first field and inspect the revealed field's value. Trace the save and reload handling for conditionally hidden fields. Done means the second field remains empty and dependent conditional logic treats it as empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.