clockwork icon indicating copy to clipboard operation
clockwork copied to clipboard

Web portal __clockwork/latest return false

Open tokidoki11 opened this issue 3 years ago • 3 comments

Version: 5.16

When checking via WebPortal /clockwork/app I can see /__clockwork/latest being called but it returns false thus leaving the page blank

Checking via Chrome Extension it is working as expected

tokidoki11 avatar May 13 '22 07:05 tokidoki11

find(null) is called on the storage instead of what I assume should be latest(). A quick workaround is to substitute FileStorage with:

class FixFileStorage extends FileStorage
{
    public function find($id)
    {
        if ($id === null) {
            return $this->latest();
        }

        return parent::find($id);
    }
}

(Clockwork 5.1.4 using \Clockwork\Support\Slim\ClockworkMiddleware.)

L-P avatar Jun 16 '22 11:06 L-P

Hey, can you please share more info about your environment?

itsgoingd avatar Jul 06 '22 21:07 itsgoingd

@itsgoingd any command you want me to run?

as a rough idea I run this this with Laravel 6 on Docker environment

tokidoki11 avatar Jul 07 '22 07:07 tokidoki11

		$clockworkDataUri = '#/__clockwork(?:/(?<id>[0-9-]+))?(?:/(?<direction>(?:previous|next)))?(?:/(?<count>\d+))?#';
		if (preg_match($clockworkDataUri, $request->getUri()->getPath(), $matches)) {
			$matches = array_merge([ 'id' => null, 'direction' => null, 'count' => null ], $matches);
			return $this->retrieveRequest($request, $matches['id'], $matches['direction'], $matches['count']);
		}

This code is from today's master branch, in three different places. It lacks support for the symbolic "latest" ID. Support for "latest" seems to be present for Laravel, Lumen and Symfony only.

UlrichEckhardt avatar Jan 17 '24 18:01 UlrichEckhardt