Painbaker
Well-known member
- Affected version
- 2.2.3
I'm trying to change order for entity relation that defined in defaultWith and nothing happens.
In this case array key 'order' seems is ignored (the column does not exist)
After deleting relation from defaultWith it works correctly.
I don't understand what prevents the sorting for default relations...
PHP:
$structure->relations['CustomStylePurchase'] = [
'entity' => 'CustomStylePurchase:Purchase',
'type' => self::TO_ONE,
'conditions' => [
['content_type', '=', $structure->contentType],
['content_id', '=', '$' . $structure->primaryKey],
],
'order' => ['purchase_date', 'DESC'],
'primary' => false
];
$structure->defaultWith += ['CustomStylePurchase'];
In this case array key 'order' seems is ignored (the column does not exist)
After deleting relation from defaultWith it works correctly.
I don't understand what prevents the sorting for default relations...