Update `coverPhotoHasWebP` in UserRebuilDataWorker
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 Aug 2021 07:30:32 +0000 (09:30 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 20 Aug 2021 07:30:32 +0000 (09:30 +0200)
wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php

index 77f32e3fc70e25c54dca467fac4c027e29ed42fe..ed61d9a67c2d0d79b6c4602385bfe2480e04428f 100644 (file)
@@ -297,9 +297,13 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker
             $userProfiles->getConditionBuilder()->add("user_table.coverPhotoHash IS NOT NULL");
             $userProfiles->readObjects();
             foreach ($userProfiles as $userProfile) {
+                $editor = new UserEditor($userProfile->getDecoratedObject());
                 $coverPhoto = $userProfile->getCoverPhoto(true);
                 if ($coverPhoto instanceof IWebpUserCoverPhoto) {
                     $coverPhoto->createWebpVariant();
+                    $editor->update([
+                        'coverPhotoHasWebP' => 1,
+                    ]);
                 }
             }
         }