SOLVED: 1.12.1 Component php query error

I appreciate your efforts in finding solutions to improve our lives!

I was massively testing the component and the query properties.

In the component instance configuration, when I go to configure a specific query property for this instance, when I switch to PHP query, the query doesn’t work well.

For example, it no longer filters by taxonomies.

Before, I used this same query in the blocks and it worked well, filtering perfectly.

Here is an image and the query I am using.

// Nome da option que armazena os campos da Options Page
$options_page = get_option('pagina-inicial'); // Substitua 'jet_engine_options_page' pelo nome correto da Options Page

// Se a Options Page estiver armazenada em um array, pegamos o valor do campo específico
$numero_de_itens_destaques = isset($options_page['numero_de_itens_destaques']) ? $options_page['numero_de_itens_destaques'] : 8; // Define 10 como valor padrão se não encontrado

return [
    'post_type' => 'imovel', // O CPT "imovel"
    'posts_per_page' => $numero_de_itens_destaques, // Usa o valor obtido da Options Page ou o valor padrão
    'meta_query' => [
        'relation' => 'AND',
        [
            'key' => 'statusi', // Filtro pelo meta field "statusi" como true
            'value' => 'true',
            'compare' => '=',
        ],
        [
            'key' => 'destaquei', // Filtro pelo meta field "destaquei" como true
            'value' => 'true',
            'compare' => '=',
        ],
        [
            'key' => '_thumbnail_id', // Certificar que o post tem uma imagem destacada
            'compare' => 'EXISTS',
        ],
    ],
    'tax_query' => [
        [
            'taxonomy' => 'finalidade', // Filtra pela taxonomia "finalidade"
            'field' => 'slug',
            'terms' => 'venda', // Apenas para posts com finalidade "venda"
        ],
    ],
];

I can confirm that moving using a PHP queries in a parameter of. component does not work.

It seems the PHP query is not taken into account for them.

1 Like

Hello @fabricioventura and @Maexxx,

thanks for the report! I was able to replicate the issue.
You are right, there is an issue with PHP query. I belive it’s because you can’t sign it - at least in my case, there is an error in the dev tools when I try to sign it. I’ve created an internal bug report for this.

Thanks,
Matej

1 Like

Hello.
I saw that there were changes in the new version, released today, it is now possible to use PHP queries in the component loop, congratulations.

I am on my test site, replacing each of the loops with components, to see what the experience is like and to know if I can now work with them safely.

I noticed a possible bug/absence in the query, when we choose the type of query: JetEngine Query Builder.

In this query of mine, I am bringing properties that belong to a store, they are favorite properties.

When selecting this type of query, and returning to the component configuration, the option: JetEngine Queries is not present, and therefore I cannot choose which query I want to apply to the component.

Thank you for your support and great contribution to our lives :slight_smile:


I have the same problem with 1.12.3, after adding a query as a component property, it’s not possible to sign the code in its query editor when using the component. If I go to code review in Bricks settings, the code block isn’t even there.

I hope you can resolve this quickly, otherwise I have to break out lots of components to individual parts, that would be a shame.

Best regards,
Andreas

Hi guys,

We fixed this issue in Bricks 2.0 beta, which is now available in your account.
Changelog: Bricks 2.0-beta Changelog – Bricks

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.

1 Like