This is an AI generated issue report, but controlled by assignee (rnsrk).
On which WissKI instance happened the incidence?
(development environment in docker wisski)
When does the issue occur?
18 August 2026, when opening a WissKI individual for edit and saving it.
On which page or in which action carried out?
Edit form of individual 16 ("Mein tolles Objekt", bundle Object): /wisski/navigate/16/edit.
After save, Drupal redirects to the canonical view: /wisski/navigate/16/view?wisski_bundle=bb48a22d36f1c15cd16b143d23466812. The warning is shown there because messenger messages persist across the redirect.
What exactly lead to the behaviour?
Opened the individual Edit tab and saved the entity. Several entity-reference fields on this bundle have the default WissKI selection handler with Sort by: label, ASC. Drupal core DefaultSelection::buildEntityQuery() then does $query->sort('label', 'ASC').
On this Object form those fields include Dimensions (IEF complex), Stay, Has Part, Data record (IEF simple), (Claimed) Ownership, and Object type or -appellation. Fields whose handler sort is _none do not trigger this warning.
In wisski_adapter_sparql11_pb/src/Query/Query.php, filter handling already treats title and label as the entity title. Sort handling only accepts rand, eid, and fields named wisski_path_{pb}__{path}. The entity-reference sort by label therefore hits:
$this->messenger->addWarning('Query contained unknown sorting criterion: ' . $field);The sort is then skipped, so referenced individuals are not ordered by label.
What did you expect? Do you want to display, configure or save something?
Opening the edit form and saving should complete without a warning. Entity-reference widgets that are configured to sort by label should actually return candidates in label order (the same title handling already used for title/label filters).
What happened instead? Did the page crash, is there an error or did the action not take place?
The entity still saves and the view still renders. After save, a warning message is shown:
Query contained unknown sorting criterion: label
Because the criterion is skipped, entity-reference results are not sorted by label.
Watchdog log
No watchdog entry for this warning. It is a Drupal messenger message from the SPARQL query class, not a PHP exception.
Drupal status message (type warning):
Query contained unknown sorting criterion: label
Emitted from wisski_adapter_sparql11_pb/src/Query/Query.php when $field is label.
Issue fork wisski-3617844
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
Comment #2
rnsrk commentedThen (scs_base)
SPARQL query sort handling in
wisski_adapter_sparql11_pb/src/Query/Query.phpbuilt SPARQLORDER BYonly forwisski_path_*,rand, andeid. Other sort fields, including Drupal's entity-keylabel, were skipped with no messenger warning.When a title condition was present,
executeEntityTitleCondition()orderedwisski_title_n_grams.ngramonly if the sort field was exactlytitle. Drupal core entity-reference selection already issues an entity query withsort('label'); it does not need a WissKI-specific reference widget.Filters already treated
titleandlabelas the same generated title. Sort handling did not.Now (8.x-4.x)
The same SPARQL sort set, plus a messenger warning for any other field. Entity-reference fields configured with Sort by: label therefore warned on edit/save. The ngram
ORDER BYstill requiredtitleonly.Compatibility
Verdict: logic broken. Compatible with scs_base runtime behavior? no (the warning is new). Drupal already owns entity-reference selection, match, and range. The SPARQL query class only has to accept the same
labelkey it already accepts as a filter.What was done
The SPARQL sort loop skips
titleandlabelwithout a warning (same skip scs_base used for unknown fields, now explicit for the entity-key alias filters already use).executeEntityTitleCondition()applies the existing ngramORDER BYwhen the sort field islabelas well astitle.No extra paging or post-sort of SPARQL result pages. Drupal's entity query / DefaultSelection still builds the query; this patch only teaches the WissKI query backend the
labelfield name.Files:
wisski_adapter_sparql11_pb/src/Query/Query.php, regression testwisski_core/tests/src/Functional/Query/LabelSortTest.php.Comment #4
rnsrk commentedComment #5
rnsrk commented