Skip to content

Disable sorting on PrettyBlocks action columns - #380

Open
PercolatingStudio wants to merge 1 commit into
mainfrom
codex/issue-331-cms-grid-sort
Open

PercolatingStudio wants to merge 1 commit into
mainfrom
codex/issue-331-cms-grid-sort

Conversation

@PercolatingStudio

Copy link
Copy Markdown
Owner

Fixes #331.

Reproduction on the published 3.2.5 ZIP

On PrestaShop 8.2.7, open Design → Pages and click the sort control on “Open in PrettyBlocks”. The grid returns HTTP 500 with Unknown column 'edit2'. Returning to the listing URL without the sort parameters still returns 500 because PrestaShop saved the invalid order for the current employee and shop.

Change

Make the shared PrettyBlocks action column non-sortable by default (CMS, products and categories). It is a link, not a database field. Document how to recover a listing that already has the bad order: open the CMS list as the affected employee in the affected shop with cms_page[orderBy]=position&cms_page[sortOrder]=asc. This uses PrestaShop's native sorting; no database edit or automatic preference migration is needed.

Thanks to @grismajeur-admin for the report and @hwctblanc for the sorting suggestion.

Validation

  • New regression test fails with the published column and passes with the fix, using the real PrestaShop column class and Symfony options resolver. It also checks the action route and an ordinary sortable column. Wired into the release smoke tests.
  • Installed the exact local candidate ZIP on PS 8.2.7/PHP 8.1.33 and PS 9.1.4/PHP 8.5.0. Smoke tests, package structure, Vite manifest/assets and the new regression test all pass. Docker Hub stalled locally, so this candidate reuses the audited 3.2.5 ZIP with only the changed class and README replaced (SHA-256 180bae34fca1c4eb4d170131eb2788efae5f39e1546dbd0e5609304c04911020). GitHub CI rebuilds it independently.
  • Browser-tested both shops: no sort control on the action column; regular title sorting and opening PrettyBlocks still work; a simulated previously saved edit2 sort recovers via the documented URL and stays recovered on the normal listing.
  • 40 Node tests, PHP syntax, shell syntax and git diff --check pass.

No version bump, migration, or release.

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.

Sorting pages with "Open in PrettyBlock" drives to a persistant error

1 participant