AdvancedCustomFields / AdvancedCustomFields/acf

acf/settings/load_json filter not parsing JSON

Open
#14 1 comment 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

Hi there,
First, i want to tell you that ACF is an amazing Plugin which helps me a lot..
Now i'm making a plugin which uses ACF
This plugin is supposed to use it's own JSON fields
I added current filter
$this->loader->add_filter('acf/settings/load_json', $this, 'acf_json_load_point');
The JSON file is loaded, and the Sync functionality works great !
BUT
The default exported JSON is found, but not parsed
When i remove the begining array chars "[" and at end "]" it works

This does not works :

[
    {
        "key": "group_5a3c0e1b7d21f",
        "title": "my title",
        "fields": [
            {
                "key"....
   ....
    }
]

But this works :

{
        "key": "group_5a3c0e1b7d21f",
        "title": "my title",
        "fields": [
            {
                "key"....
   ....
}

It will be good if you take a look on how the JSON is parsed using the filter...

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 through the acf/settings/load_json filter with the exported JSON examples in the report. Trace the filter's JSON loading and parsing path; done means exported JSON wrapped in an outer array loads and parses correctly while preserving the existing sync behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.