Comments (1)
Looking under the hood this is not an issue.
The element that determins the sorting of the relartions is the array of UUIDs .
In the dataset i created for testing stories-rleations.json
the order is:
["997cfee2-cec3-4cad-9e06-7ef3d72f5b7d", "ba307a05-2b91-4ce8-ab24-bf328da1adb4", "c3a321a5-1163-4281-8643-2c79c13e22a3"]
so i created a specific test:
test('v2: check sorting for relations', function () {
$client = new Client('test', null, $version = 'v2');
// $client->editMode(false);
$client->mockable([
mockResponse('stories-relations', ['x-test' => 1], $version),
]);
$client->resolveRelations('popular-articles.articles');
$story = $client->getStoryBySlug('home')->getBody();
$this->assertArrayHasKey('story', $story);
$this->assertArrayHasKey('rels', $story);
// With the dataset provided the right order should be
// ["997cfee2-cec3-4cad-9e06-7ef3d72f5b7d", "ba307a05-2b91-4ce8-ab24-bf328da1adb4", "c3a321a5-1163-4281-8643-2c79c13e22a3"]
$this->assertEquals(
'997cfee2-cec3-4cad-9e06-7ef3d72f5b7d',
$story['story']['content']['body'][1]['articles'][0]['uuid'],
'checking the first relation'
);
$this->assertEquals(
'ba307a05-2b91-4ce8-ab24-bf328da1adb4',
$story['story']['content']['body'][1]['articles'][1]['uuid'],
'checking the second relation'
);
$this->assertEquals(
'c3a321a5-1163-4281-8643-2c79c13e22a3',
$story['story']['content']['body'][1]['articles'][2]['uuid'],
'checking the third relation'
);
});
So i can close this issue.
I don't want to delete it to keep track in the history. If some developer has this kind of misunderstanding, the developer can find some explanation here (with the test I added in this comment).
from storyblok-php-client.
Related Issues (20)
- v2 breaks support of PHP<8 due to symphony dependency HOT 3
- Make level of relation resolving overwritable
- Support symfony/cache 7.0 HOT 2
- Language is not respected if a single story should be fetched
- Infinite recursion in V2, when _storyblok_published is set HOT 1
- The getLinks method takes options which are not keyed in the cache
- Huge memory consumption in v2 HOT 3
- Storyblok can't be used with PHP 8.1 and Symfony v6 (or rather `symfony/cache` >=6.0) HOT 3
- Please create a new tag with the last changes from march HOT 2
- Language is not taken into consideration when caching / checking the cache HOT 1
- Why is this repository so neglected? Is contribution still appreciated? HOT 3
- Compatibility with PHP 8.2 HOT 1
- Add "default_lifetime" cache option for start using defaultLifetime param for caching
- Feature: Introducing Static Code Analysis, PHPStan and refactor at least for level 2 HOT 2
- Feature: increase PHPstan at level 3
- Improve exception handling HOT 1
- Support more cache drivers or allow users to create their own HOT 1
- Client->getStories not respecting release HOT 1
- Upgrade for PHP cs fixer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storyblok-php-client.