Problem/Motivation

Follow up from #3574506: Sorting by Views result counter causes ORDER BY unknown from @alexpot

fix existing views as the view configuration is only fixed if you return to the table settings and press save.

Steps to reproduce

NA

Proposed resolution

Fix any existing config

Remaining tasks

Implement

User interface changes

NA

Introduced terminology

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Issue fork drupal-3588188

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

smustgrave created an issue. See original summary.

kieran.cott made their first commit to this issue’s fork.

kieran.cott’s picture

Status: Active » Needs review

I've taken a pass at implementing this, I hope I've understood #3574506 correctly.

MR 16077 adds a Views config updater method that finds table displays with result counter fields and sets their stored table `sortable` setting to `FALSE`. Then adds a new Views post-update to run that updater for existing views.

Open to suggestions for improvement.

quietone’s picture

Title: Fix existing views with click sortable per #3574506 » Add post update to fix existing views with click sortable
smustgrave’s picture

Status: Needs review » Needs work

Looks good! But left a comment around the MR. Would check in gitlab 11.x branch for examples. Reason they're not on main is they've been removed already for D12

kieran.cott’s picture

Status: Needs work » Needs review

Thanks @smustgrave, I've added CounterFieldTableSortableUpdateTest under Functional\Update which hopefully mirrors the example you mentioned in the MR.

dcam’s picture

Status: Needs review » Needs work

Thank you for your work to improve Drupal. I reviewed the MR and found several items that need to be addressed or explained. I left comments on the MR about them.

kieran.cott’s picture

Status: Needs work » Needs review

Appreciate you taking the time to review @dcam, I've replied to your comments and made some changes.