Giter Site home page Giter Site logo

Comments (8)

bobbingwide avatar bobbingwide commented on July 4, 2024

The "other" field groups are those with Sync available. There are twelve of them.
Checkbox select, Choice and Clone Me show as being associated with Location Posts. The others are marked as Various

image

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

Updating to ACF Pro v6.2.7 didn't resolve the issue.
Nor did updating to WordPres 6.5-RC2

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

The field problem could be that there's a field group called labelled_acf_field which contains a field Named display_label with Key field_65c0af48ebef0 and label Display label.
This is used in preference to the display-label field which is defined using the code.
It's a problem even when the field group is marked as Inactive.

I'll try deleting this Field group.

That worked.

With the label displayed:

image

Without the label:

image

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

After Syncing the Advanced field group and toggling the value of Settings > Group Settings > Show in REST API the Location has changed to Posts. Toggling off the Show in REST API field doesn't stop the Meta box from being displayed.

I haven't yet worked out what causes the Location to display as Various.
Marking the field group as Deactivated only works for Field groups that have been Synced.

I raised a ticket with WP Engine.

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

OK, looking at the Field group .json files I've got a fairly good idea why some Groups are marked Post and others Various.

Field group Group last 3 digits Location Post type(s)
Advanced 969 Posts now contains post only
Basic b84 Various test-acf-fields
Content 558 Various block_example, test-acf-fields
Checkbox select e11 Posts post
Choice 183 Posts block_example, post

The group is shown as Various when the location only contains unknown post types.
ie when none of the post types are registered.

"location": [
        [
            {
                "param": "post_type",
                "operator": "==",
                "value": "test-acf-fields"
            }
        ]
    ],

Obviously, since none of the post types are registered, the meta boxes aren't displayed.

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

There's another problem with the field labelled Cycle Transition Effect, name fx, key field_645e28e9f47da

  • This appeared to be associated with the Repeater field group for post type Block examples.
  • I imported Repeater and deactivated it
  • Next time I looked the field became associated with the Relational field group.
  • Ditto for Relational
  • Then it was associated with Layout.

I don't know how this happens. There's something going haywire that's for sure.

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

I don't know how this happens. There's something going haywire that's for sure.

In field_block_for_acf_pro_get_possible_field_names() the call to find the fields associated with each field group

$raw_fields=acf_get_fields( $field_group['ID'] );

was passing the ID of the field group.
In some instances the ID of the field group was 0.
The function was erroneously returning the fx field labelled Cycle Transition Effect.

I couldn't reproduce the problem just now.
It would seem that having imported all the unsynched Field groups the IDs are all set.

I was able to reproduce the problem by deleting a row for post type acf-field-group from the wp_posts table.
This then caused the Field group to require Syncing again.
Since there was no post for the Field group the ID was 0

   [0] => Array

        [ID] => (integer) 0
        [key] => (string) "group_64abd48c9b969"
        [title] => (string) "Advanced"
        [fields] => Array
        [location] => Array

            [0] => Array

                [0] => Array

                    [param] => (string) "post_type"
                    [operator] => (string) "=="
                    [value] => (string) "post"



        [menu_order] => (integer) 0
        [position] => (string) "normal"
        [style] => (string) "default"
        [label_placement] => (string) "top"
        [instruction_placement] => (string) "label"
        [hide_on_screen] => (string) ""
        [active] => (boolean) 1
        [description] => (string) "Advanced type fields: 4 pickers, Date, Date-Time, Time, Color"
        [show_in_rest] => (integer) 0
        [local] => (string) "json"
        [modified] => (integer) 1710586908
        [local_file] => (string) "C:\apache\htdocs\cwiccer/wp-content/themes/fizzie/acf-json/group_64abd48c9b969.json"
        [_valid] => (boolean) 1

The logic failed when processing the acf/prepare_field/name=acf-field-name filter, within
the_content,acf/prepare_field

It worked fine when called for acf/include_fields within init.

from field-block-for-acf-pro.

bobbingwide avatar bobbingwide commented on July 4, 2024

The fx field labelled "Cycle Transition Effect" is created by the oik-testimonials plugin for the oik-testimonials/acf-cycler block.

    [0] => Array

        [ID] => (integer) 0
        [key] => (string) "field_645e28e9f47da"
        [label] => (string) "Cycle Transition Effect"
        [name] => (string) "fx"
        [aria-label] => (string) ""
        [prefix] => (string) "acf"
        [type] => (string) "select"
        [value] => (NULL) 
        [menu_order] => (integer) 0
        [instructions] => (string) ""
        [required] => (integer) 0
        [id] => (string) ""
        [class] => (string) ""
        [conditional_logic] => (integer) 0
        [parent] => (string) "group_645e28e943198"
        [wrapper] => Array

            [width] => (string) ""
            [class] => (string) ""
            [id] => (string) ""

        [choices] => Array

            [fade] => (string) "fade"
            [blindX] => (string) "blindX"
            [blindY] => (string) "blindY"
            [blindZ] => (string) "blindZ"
            [cover] => (string) "cover"
            [curtainX] => (string) "curtainX"
            [curtainY] => (string) "curtainY"
            [fadeZoom] => (string) "fadeZoom"
            [growX] => (string) "growX"
            [growY] => (string) "growY"
            [none] => (string) "none"
            [scrollUp] => (string) "scrollUp"
            [scrollDown] => (string) "scrollDown"
            [scrollLeft] => (string) "scrollLeft"
            [scrollRight] => (string) "scrollRight"
            [scrollHorz] => (string) "scrollHorz"
            [scrollVert] => (string) "scrollVert"
            [shuffle] => (string) "shuffle"
            [slideX] => (string) "slideX"
            [slideY] => (string) "slideY"
            [toss] => (string) "toss"
            [turnUp] => (string) "turnUp"
            [turnDown] => (string) "turnDown"
            [turnLeft] => (string) "turnLeft"
            [turnRight] => (string) "turnRight"
            [uncover] => (string) "uncover"
            [wipe] => (string) "wipe"
            [zoom] => (string) "zoom"

        [default_value] => (string) "fade"
        [return_format] => (string) "value"
        [multiple] => (integer) 0
        [allow_null] => (integer) 0
        [ui] => (integer) 0
        [ajax] => (integer) 0
        [placeholder] => (string) ""
        [_name] => (string) "fx"
        [_valid] => (integer) 1

The fix is to pass the $field_group structure to the call, not just the ID.

$raw_fields=acf_get_fields( $field_group );

from field-block-for-acf-pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.