Hi there,
i was investigating an error on the order detail page (already reported here: https://www.joomshaper.com/forum/question/35478) and found a completly different bug instead.
In the file admin/src/Traits/Media.php the function clearTemporaryImages() always returns an error because an else is missing
public function clearTemporaryImages()
{
$requestMethod = $this->getInputMethod();
$this->checkNotAllowedMethods(['POST', 'PUT', 'PATCH', 'DELETE'], $requestMethod);
$clientId = $this->getInput('client_id', '', 'STRING');
$imageModel = new MediaModel();
$response = new \stdClass();
if ($imageModel->clearTemporaryImages($clientId)) {
$this->removeTemporaryFiles($clientId);
$response->status = true;
}
$response->status = false;
$this->sendResponse($response);
}
should be:
public function clearTemporaryImages()
{
$requestMethod = $this->getInputMethod();
$this->checkNotAllowedMethods(['POST', 'PUT', 'PATCH', 'DELETE'], $requestMethod);
$clientId = $this->getInput('client_id', '', 'STRING');
$imageModel = new MediaModel();
$response = new \stdClass();
if ($imageModel->clearTemporaryImages($clientId)) {
$this->removeTemporaryFiles($clientId);
$response->status = true;
} else {
$response->status = false;
}
$this->sendResponse($response);
}
Not sure what it does anyway, but every bug less in easy store is a good thing i guess? :-)