You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is is a framework issue or I'm doing something wrong with the ORM. I'm querying a couple different models and using a collection to display them sorted by the modified property to make a makeshift news feed. This is on the latest Cake release, 3.0.9.
The problem is in the sortBy method for the Collection. The expected behavior is all the various models to be in the $recent collection and sorted by their modified date descending.
The only sort method that returns as expected is SORT_NUMERIC, but it throws the error: Object of class Cake\I18n\Time could not be converted to double twice. Changing to SORT_NATURAL, SORT_STRING, SORT_LOCALE_STRING or leaving the sort option off will display the wrong entities based on the date.
Suppressing the error will also cause the incorrect sort order. I tried also just passing the result sets into the new collection, but the sort ordering was incorrect as well.
Any help or direction would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
Not sure if this is is a framework issue or I'm doing something wrong with the ORM. I'm querying a couple different models and using a collection to display them sorted by the
modified
property to make a makeshift news feed. This is on the latest Cake release, 3.0.9.The problem is in the sortBy method for the Collection. The expected behavior is all the various models to be in the
$recent
collection and sorted by theirmodified
date descending.The only sort method that returns as expected is
SORT_NUMERIC
, but it throws the error:Object of class Cake\I18n\Time could not be converted to double
twice. Changing toSORT_NATURAL
,SORT_STRING
,SORT_LOCALE_STRING
or leaving the sort option off will display the wrong entities based on the date.Suppressing the error will also cause the incorrect sort order. I tried also just passing the result sets into the new collection, but the sort ordering was incorrect as well.
Any help or direction would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: