\Drupal\views\Plugin\views\field\EntityOperations isn't setting click sortable to FALSE, so when you click sort on this field you see
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown' in 'order clause':
Two ways to fix this:
- Set 'click sortable' for 'operations' to FALSE in \Drupal\views\EntityViewsData::getViewsData
- Override function clickSortable()
in \Drupal\views\Plugin\views\field\EntityOperations
and make it return FALSE
I would argue for the second option, since there is no way this handler should ever be click sortable even if you want to reuse it in another Views data setting and would possible use a different setting for (or fail to set) 'click sortable'.
Setting to major because an exception is thrown.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2830196-4.patch | 3.08 KB | Lendude |
#4 | 2830196-4-TEST_ONLY.patch | 2.6 KB | Lendude |
#2 | 2830196-2.patch | 493 bytes | Lendude |
Comments
Comment #2
LendudePatch that sets click sorting to FALSE on the handler, this still needs tests.
Comment #4
LendudeAnd a test. Interdiff is the test-only patch.
Comment #6
nicrodgersReplicated problem. Applied patch successfully, problem fixed. Code looks clean. Nice one!
Comment #8
LendudeUnrelated fail, back to RTBC
Comment #11
xjmThis fix makes sense to me. Major is the appropriate priority according to https://www.drupal.org/core/issue-priority#major-bug since a user can trigger an exception through the UI, but it only affects administrative users in this one narrow circumstance.
I hesitated on adding Views UI to the existing handler test, but eh, it's probably okay.
Thanks @Lendude and @nicrodgers! Committed and pushed to 8.3.x and 8.2.x.