Bug In ClearTemporaryImages() - Question | JoomShaper
SP Page Builder 6 is Here! Learn More →

Bug In ClearTemporaryImages()

B

bergwerk

EasyStore 1 year ago

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? :-)

0
3 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #171010

Hello bergwerk

Thanks for your feedback. I have forwarded your issue to the developer team. They will check it soon. However, can you share more details of the issue?

clearTemporaryImages() always returns an error

Where do you see the error? On the frontend or admin panel? Please share a screenshot of your issue to understand it better. Take a screenshot and share via any platform. For example: Lightshot or Imgur

Best regards

0
B
bergwerk
Accepted Answer
1 year ago #171055

Hi Ofi,

ah sorry, i forgot to mention. It's not visible per se, but it is a hidden ajax request when opening the order detail page: https://imgur.com/Ydk3zX1

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #171072

I have got feedback from the developer team. It will be fixed in the next version. Thanks for finding out this.

Please accept the answer that helped you. Finding the solution for the other users with the same issue will be easier. There is a button to accept answers after each comment.

0