Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Nested Queries in BricksBuilder Using JetEngine for Custom Content Type (CCT) Fields #7957

Open
pegujurado opened this issue Jan 19, 2025 · 2 comments
Assignees
Labels
bug Something isn't working JetEngine

Comments

@pegujurado
Copy link

Problem Description:

We are encountering an issue with the integration of BricksBuilder and JetEngine when using the Query Builder to display information related to a Custom Content Type (CCT) and associated users. Below is the scenario:

We have created a CCT called "Projects CCT", which includes, among other fields, the following:

custom_user_id: A field that stores the ID of an associated user.
responsible_user_id: Another field that stores the ID of another associated user.
In BricksBuilder (Query Loop):

We created a query using JetEngine's Query Builder to retrieve all records from the "Projects CCT". This query is displayed correctly as a set of cards.
Inside each card, we added additional queries (Query Loop):
A query of type Users that uses the custom_user_id field from the current CCT to retrieve data for the associated user. This query works correctly.
Another similar query of type Users that uses the responsible_user_id field from the current CCT to retrieve data for the associated user.
Issue Identified:

The second query (based on responsible_user_id) returns the user with the lowest ID in WordPress (in this case, user ID 1) instead of the correct user (which should be ID 20).
It seems that an error occurs in BricksBuilder, preventing the addition of more than one nested query inside an existing query when using the Query Builder with CCT and Users.
Test Performed:

When using a Listing Grid instead of BricksBuilder directly, the queries work correctly for both custom_user_id and responsible_user_id.
Steps to Reproduce the Issue:

Create a CCT with custom fields referencing user IDs (custom_user_id and responsible_user_id).
Configure a query in BricksBuilder using JetEngine's Query Builder to display all CCT records as a set of cards.
Within each card, configure additional Users queries:
One query using the custom_user_id field from the current CCT.
Another query using the responsible_user_id field from the current CCT.
Observe that the second query (based on responsible_user_id) returns incorrect data (the user with the lowest ID), while the first query works as expected.
Repeat the process using Listing Grid instead of BricksBuilder, and verify that both queries work correctly.
Impact:

It is not possible to nest more than one query in BricksBuilder, which limits the functionality of CCTs in scenarios requiring multiple user relationships.

Software and Tools Versions Used:

JetEngine: Latest stable release (non-beta).
BricksBuilder: Latest stable release (non-beta).
WordPress: Latest stable release.
PHP: Latest stable release.
Conclusion:

This behavior suggests a limitation or bug in BricksBuilder when handling multiple nested queries within a CCT. We kindly request your assistance in identifying the cause and a possible solution.

Additional Note:

We have verified that when using a Listing Grid, nested queries work as expected, which confirms that the issue lies specifically with BricksBuilder.

If you need further details or access to the development environment, please let us know. @MjHead

@MjHead MjHead self-assigned this Jan 22, 2025
@MjHead MjHead added JetEngine bug Something isn't working labels Jan 22, 2025
@MjHead
Copy link
Collaborator

MjHead commented Jan 22, 2025

Thanks for the detailed description. Fix is planned for 3.6.4 update

@pegujurado
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working JetEngine
Projects
None yet
Development

No branches or pull requests

2 participants