From a0601ddc5e3ef683c87667e2157b9a5cc4968c57 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Wed, 17 Apr 2024 16:47:39 +0600 Subject: [PATCH] pkp/pkp-lib#9811 removed invalid method setCoverImage from ContextService class --- classes/services/ContextService.inc.php | 37 +++++++++---------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/classes/services/ContextService.inc.php b/classes/services/ContextService.inc.php index 7ca52705730..cfbfb4c0f1d 100644 --- a/classes/services/ContextService.inc.php +++ b/classes/services/ContextService.inc.php @@ -185,7 +185,7 @@ public function resizeCoverThumbnails($context, $maxWidth, $maxHeight) { \DAORegistry::getDAO('SeriesDAO'), \DAORegistry::getDAO('SubmissionDAO'), ]; - foreach ($objectDaos as $objectDao) { + foreach ($objectDaos as $objectDao) { /** @var CategoryDAO|SeriesDAO|SubmissionDAO $objectDao */ $objects = $objectDao->getByContextId($context->getId()); while ($object = $objects->next()) { if (is_a($object, 'Submission')) { @@ -243,29 +243,18 @@ public function resizeCoverThumbnails($context, $maxWidth, $maxHeight) { } imagedestroy($thumbnail); - if (is_a($object, 'Submission')) { - $object->setCoverImage(array( - 'name' => $cover['name'], - 'width' => $cover['width'], - 'height' => $cover['height'], - 'thumbnailName' => $cover['thumbnailName'], - 'thumbnailWidth' => $thumbnailWidth, - 'thumbnailHeight' => $thumbnailHeight, - 'uploadName' => $cover['uploadName'], - 'dateUploaded' => $cover['dateUploaded'], - )); - } else { - $object->setImage(array( - 'name' => $cover['name'], - 'width' => $cover['width'], - 'height' => $cover['height'], - 'thumbnailName' => $cover['thumbnailName'], - 'thumbnailWidth' => $thumbnailWidth, - 'thumbnailHeight' => $thumbnailHeight, - 'uploadName' => $cover['uploadName'], - 'dateUploaded' => $cover['dateUploaded'], - )); - } + + $object->setImage(array( + 'name' => $cover['name'], + 'width' => $cover['width'], + 'height' => $cover['height'], + 'thumbnailName' => $cover['thumbnailName'], + 'thumbnailWidth' => $thumbnailWidth, + 'thumbnailHeight' => $thumbnailHeight, + 'uploadName' => $cover['uploadName'], + 'dateUploaded' => $cover['dateUploaded'], + )); + // Update category object to store new thumbnail information. $objectDao->updateObject($object); }