From: Mikael Nordfeldth Date: Wed, 20 Jul 2016 22:37:43 +0000 (+0200) Subject: Select the first generated thumbnail, which should be the proper size X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1981cb76622977ed3a0a480bfcb427b09ca3c688;p=quix0rs-gnu-social.git Select the first generated thumbnail, which should be the proper size ...most of the time. If all works well. --- diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php index 968883f2b8..91ba653744 100644 --- a/classes/File_thumbnail.php +++ b/classes/File_thumbnail.php @@ -98,6 +98,7 @@ class File_thumbnail extends Managed_DataObject if ($notNullUrl) { $thumb->whereAdd('url IS NOT NULL'); } + $thumb->orderBy('modified ASC'); // the first created, a somewhat ugly hack $thumb->limit(1); if (!$thumb->find(true)) { throw new NoResultException($thumb);