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

Possible issue of grid/resource provider for Inherited Resource grid request. #310

Open
FlorentinGarnier opened this issue Dec 14, 2022 · 1 comment

Comments

@FlorentinGarnier
Copy link

Sylius version affected: ^1.11

Description
A very weird SQL request is generated when we use Grid for displaying a resource inherited of an doctrine inherited entity. If we configure a sorting by a field from the Base Entity

Steps to reproduce
Capture d’écran du 2022-12-13 18-41-49

SELECT
  DISTINCT id_9
FROM
  (
    SELECT
      DISTINCT id_9,
      s0_.number
    FROM
      (
        SELECT
          s0_.number AS number_0,
          s0_.notes AS notes_1,
          s0_.state AS state_2,
          s0_.checkout_completed_at AS checkout_completed_at_3,
          s0_.items_total AS items_total_4,
          s0_.adjustments_total AS adjustments_total_5,
          s0_.total AS total_6,
          s0_.created_at AS created_at_7,
          s0_.updated_at AS updated_at_8,
          s0_.id AS id_9,
          s0_.currency_code AS currency_code_10,
          s0_.locale_code AS locale_code_11,
          s0_.checkout_state AS checkout_state_12,
          s0_.payment_state AS payment_state_13,
          s0_.shipping_state AS shipping_state_14,
          s0_.created_by_guest AS created_by_guest_15,
          s0_.token_value AS token_value_16,
          s0_.customer_ip AS customer_ip_17,
          s0_.discr AS discr_18
        FROM
          app_market_order a1_
          INNER JOIN sylius_order s0_ ON a1_.id = s0_.id
        WHERE
          a1_.market_id IN (?)
      ) dctrn_result_inner
    ORDER BY
      s0_.number DESC
  ) dctrn_result
LIMIT
  10

s0_.number is not known at this level of the request.

I have copy the order grid configuration. And I can't sorting by number.

Possible Solution

@FlorentinGarnier FlorentinGarnier changed the title Possible bug of grid/resource provider for Inherited Resource grid request. Possible issue of grid/resource provider for Inherited Resource grid request. Dec 14, 2022
@coldic3
Copy link

coldic3 commented Jan 31, 2023

Hey @FlorentinGarnier,

thanks a lot for raising the issue. If I understand correctly this is more about SyliusGridBundle rather than Sylius/Sylius itself. You could have created the issue directly at Sylius/SyliusGridBundle. Anyway, we've added it to our backlog but it doesn't have a big priority right now. If you have some possible solution for this problem, feel free to propose it and then we'll be able to take care of it a bit sooner 💃

@jakubtobiasz jakubtobiasz transferred this issue from Sylius/Sylius Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants