DUPLICATE: Can't sign code in components

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

[Please describe this bug in as much detail as possible so we can replicate & debug this bug]

Components won’t let me sign any code blocks in query loops, regardless of if on the instance or main component.

Hi Rob,
Thanks so much for your report!

I’m a bit confused by the version number, since components have only been available since 1.12 :slight_smile:

Anyways, I cannot reproduce the issue. Would you please provide a screencast using https://jam.dev showing and explaining what’s happening and how to replicate the issue?

Best regards,
timmse

1 Like

Yes course @timmse - thank you.

Please see:

I know it’s mute and you really hate that, I get it, but it’s basically me trying to sign the code in an instance, over and over, and then I edit the default option (and that actually does save now, it didn’t before.)

As you can see, the default instance query won’t sign. Weirdly though it’s not ‘red’ though when I go off and come back on it.

The query returns nothing either, until I remove it from the component as normal divs/blocks and then it works immediately.

Move it out of the component and the gallery loads immediately:

DOM for references, non component above that shows the gallery. Duplicated section, exactly the same contents.
Screenshot 2025-04-16 at 17.10.00

I’ve worked around this for now by pulling all of the sections out of the components.

I would argue it’s my code or something I’m missing/install based, but it’s clear as soon as I remove it from the component it works fine.

Just to test it, I’ve converted the working section now into a component (new one) and it’s immediately made the content disappear.

I still can’t seem to sign the code, but why would this not work in a component?

$acf_images_homex = get_field("top_image_gallery_images");

if (!empty($acf_images_homex)) {
    return [
        'post_type' => 'attachment',
        'post_mime_type' => 'image',
        'post_status' => 'inherit',
        'orderby' => 'post__in',
        'post__in' => $acf_images_homex,
        'posts_per_page' => -1,
    ];
} else {
    return [];
}

Screenshot 2025-04-17 at 10.49.54

Hi Rob,
Aah, you are using the PHP query editor :bulb:

Then this is a known bug:

I’ll close this thread. We’ll update the original report once the issue is fixed :v:

1 Like