Skip to content

Fix - Sortable table for order items and associated items #435

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

Merged
merged 2 commits into from
Jun 25, 2025

Conversation

RomainLvr
Copy link
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • [] I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !35243
  • Here is a brief description of what this PR does
  1. Corrected sorting on ID, which was based on characters rather than numbers
  2. Fixed parameter memory (limit, page and sorted column)

@RomainLvr RomainLvr requested review from stonebuzz, Rom1-B and Lainow May 9, 2025 11:08
@RomainLvr RomainLvr self-assigned this May 9, 2025
@stonebuzz stonebuzz self-requested a review May 9, 2025 11:39
@stonebuzz
Copy link
Contributor

Associated item always have the bug (limit)

image

@stonebuzz
Copy link
Contributor

@RomainLvr can you check

@stonebuzz
Copy link
Contributor

ORDER clause seems to be applied on ref.name column

	
SELECT  items.`id` AS IDD,
                          ref.`id` AS id,
                          ref.`templates_id`,
                          items.`states_id`,
                          items.`entities_id`,
                          items.`delivery_date`,
                          items.`delivery_number`,
                          ref.`name`,
                          ref.`itemtype`,
                          items.`items_id`,
                          items.`price_taxfree`,
                          items.`discount`
                   
FROM `glpi_plugin_order_orders_items` as items,
                        `glpi_plugin_order_references` ref
                   
WHERE items.`plugin_order_orders_id` = '1'
                    AND items.`plugin_order_references_id` = '1'
                    AND items.`plugin_order_references_id` = ref.`id`
                    AND items.`states_id` = '1'AND items.`itemtype` NOT LIKE 'PluginOrderReferenceFree' ORDER BY ref.`name` LIMIT 5 OFFSET 0

@RomainLvr
Copy link
Contributor Author

ORDER clause seems to be applied on ref.name column

	
SELECT  items.`id` AS IDD,
                          ref.`id` AS id,
                          ref.`templates_id`,
                          items.`states_id`,
                          items.`entities_id`,
                          items.`delivery_date`,
                          items.`delivery_number`,
                          ref.`name`,
                          ref.`itemtype`,
                          items.`items_id`,
                          items.`price_taxfree`,
                          items.`discount`
                   
FROM `glpi_plugin_order_orders_items` as items,
                        `glpi_plugin_order_references` ref
                   
WHERE items.`plugin_order_orders_id` = '1'
                    AND items.`plugin_order_references_id` = '1'
                    AND items.`plugin_order_references_id` = ref.`id`
                    AND items.`states_id` = '1'AND items.`itemtype` NOT LIKE 'PluginOrderReferenceFree' ORDER BY ref.`name` LIMIT 5 OFFSET 0

i've removed it 👍

@stonebuzz
Copy link
Contributor

waiting for feeback

@stonebuzz stonebuzz merged commit ccb0485 into pluginsGLPI:main Jun 25, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants