File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ public function process($field)
30
30
{
31
31
if ($ ids = $ this ->fetchValue ($ field )) {
32
32
$ connection = $ this ->post ->getConnectionName ();
33
- $ attachments = Post::on ($ connection )->whereIn ('ID ' , $ ids )->get ();
33
+
34
+ $ ids_ordered = implode (', ' , $ ids );
35
+
36
+ $ attachments = Post::on ($ connection )->whereIn ('ID ' , $ ids )
37
+ ->orderByRaw ("FIELD(ID, $ ids_ordered) " )->get ();
34
38
35
39
$ metaDataValues = $ this ->fetchMultipleMetadataValues ($ attachments );
36
40
Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ public function testGalleryFieldValue()
97
97
$ this ->assertTrue (strlen ($ image ->url ) > 0 );
98
98
}
99
99
100
- // Testing the image in the 6th position
101
- $ image = $ gallery ->get ()->get (6 );
100
+ // Testing the image in the 0th position
101
+ $ image = $ gallery ->get ()->get (0 );
102
102
$ this ->assertEquals (1920 , $ image ->width );
103
103
$ this ->assertEquals (1080 , $ image ->height );
104
104
}
You can’t perform that action at this time.
0 commit comments