Tagger: Group Sort Field Rank not displaying Tags

I set my Tagger group Sort Field to Rank but this results in my tags not being displayed at all when looking in the Tagger tab on the resource. It just displays the group title but no tags below to assign.

Setting Sort Field to Alias like it is by default works like expected.

Here are my exact group settings:
Screenshot 2023-01-26 142122

This looks like a bug to me, or is there something else, I have to setup here?
No errors in the log.

MODX 2.8.4.-pl
PHP 8.0

I tested it (same MODX & PHP versions, Tagger 1.12.0-pl), but I can’t reproduce the problem.

Is there anything special in the tag you are displaying? Maybe apostrophes or special characters in the text?

There is hyphens (-) and umlauts, but only hyphens (and no spaces) in the alias, I made sure to rewrite the umlauts in there.

I didn’t think this would be a problem, as they worked perfectly fine when sorting by alias.

I remembered. It’s the problem with MySQL8 where “rank” is a reserved keyword.

Here is a fix:

Thanks that worked great in the case of displaying the tags again. It looks like the tags are now sorted by id though, and not by the given rank value.

Really?
What exactly did you change in the code?

I replaced line 34 in core/components/tagger/processors/mgr/extra/gettags.class.php:

// $c->sortby($sortField,$sortDir);
$c->sortby($this->modx->quote($sortField), $sortDir);

It turns out, the solution from the other thread was wrong.

It should be:

$c->sortby($this->modx->escape($sortField), $sortDir);

(escape instead of quote.)

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.