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
When calling toArray() on an object of type Bolt\Entity\Content you'll get a serialized version of the content. However, the current implementation always returns the empty array for 'relations'.
Get a reference to a content object in php that has at least one relation set and call $myContentItem->toArray();
The resulting array has a key 'relations' that will be [], even if the content does have a relation.
Expected result
I'd expect the toArray() call to either return with the actual relations, or alternatively without the 'relations' key at all. In the last case I'd expect this to be mentioned in the phpdoc of the function.
Actual result
The key 'relations' is always [].
The text was updated successfully, but these errors were encountered:
When calling
toArray()
on an object of typeBolt\Entity\Content
you'll get a serialized version of the content. However, the current implementation always returns the empty array for 'relations'.Details
Reproduction
Take a look at the source of Content.php (https://github.com/bolt/core/blob/6d838da3e4bebfd702f4512200295d7b840d7846/src/Entity/Content.php) and locate the toArray() function to the 'relations' being set to []
core/src/Entity/Content.php
Line 714 in 6d838da
Steps to reproduce
Get a reference to a content object in php that has at least one relation set and call $myContentItem->toArray();
The resulting array has a key 'relations' that will be [], even if the content does have a relation.
Expected result
I'd expect the toArray() call to either return with the actual relations, or alternatively without the 'relations' key at all. In the last case I'd expect this to be mentioned in the phpdoc of the function.
Actual result
The key 'relations' is always [].
The text was updated successfully, but these errors were encountered: