Hi all,

it seems when you have a cck field defined in views and you rewrite the output of it, when you have sortable columns activated on that field, the column will sort on the original field, not on the rewritten field output.

Let's say you have the two text fields with values:

Dylan
Bob

After rewriting there is:

ByeDylan
HiBob

When you sort the column you get:

HiBob
ByeDylan

And that's wrong. :)
Tried and tested it: it always sort on the non-rewritten values.

Is this easy to fix for you guys? ;-)

Thanks!

Comments

merlinofchaos’s picture

Category: bug » support
Status: Active » Closed (works as designed)

That's the only way it can work.

The sort is done as part of the query. The rewrite happens after the query is done. If you want to sort on rewritten data, you must use something like computed field that will rewrite the data and store it in the database, so that it can then be sorted on.

jvdurme’s picture

Yeah, I constructed something like this now.
Thanks for the reply :)