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)
3030 {
3131 if ($ ids = $ this ->fetchValue ($ field )) {
3232 $ 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 ();
3438
3539 $ metaDataValues = $ this ->fetchMultipleMetadataValues ($ attachments );
3640
Original file line number Diff line number Diff line change @@ -97,8 +97,8 @@ public function testGalleryFieldValue()
9797 $ this ->assertTrue (strlen ($ image ->url ) > 0 );
9898 }
9999
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 );
102102 $ this ->assertEquals (1920 , $ image ->width );
103103 $ this ->assertEquals (1080 , $ image ->height );
104104 }
You can’t perform that action at this time.
0 commit comments