I have a simple question : How make a fetch attribute filter with numeric sort on a "Text Line" attribute ?
I have a class with a text line attribute, the content of this attribute in all object is always numeric but at the origin of the project. This attribute must be a string...
So, today I had to do a attribute_filter greater than a number, but like my attribute is a text line eZ sort in alphanumeric mode...
And alphanumeric sort result is different of a pure numeric sort with numeric strings ?? Strange ...
You should see how works extended attributes filter, you can do some complex queries with it.
Personnaly, I would build my own custom fetch method in an extension, it's not really difficult. In it, you could "normally" fetch your nodes, associate it in an array with the line text content, parse the array to convert the line text content to a pure numeric type, then sort it according to numeric values, and finally return the sorted nodes.
You should probably convert it using ezchangeclass, you can write custom converter code for the ezstring to ezint conversion.
It's quite simple, you only need to map data_string to data_int. PS: ezchangeclass contains a couple of known bugs, so I will upload the new version later today!