Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Object/IdentifiableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function getId()
throw new RuntimeException('Id member is not a string.');
}

if (empty($id)) {
if (empty($id) && '0' !== $id) {
throw new RuntimeException('Id member is an empty string.');
}

Expand Down
14 changes: 8 additions & 6 deletions src/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,21 @@ public function __construct(ResolverInterface $resolver, ?IlluminateRoute $route
public function substituteBindings(StoreInterface $store): void
{
/** Cache the ID values so that we still have access to them. */
$this->resourceId = $this->getResourceId() ?: false;
$this->processId = $this->getProcessId() ?: false;

$tempResourceId = $this->getResourceId();
$tempProcessId = $this->getProcessId();
$this->resourceId = isset($tempResourceId) ? $tempResourceId : false;
$this->processId = isset($tempProcessId) ? $tempProcessId : false;

/** Bind the domain record. */
if ($this->resourceId) {
if (!empty($this->resourceId) || '0' === $this->resourceId) {
$this->route->setParameter(
ResourceRegistrar::PARAM_RESOURCE_ID,
$store->findOrFail($this->getResourceType(), $this->resourceId)
);
}

/** Bind the async process. */
if ($this->processId) {
if (!empty($this->processId) || '0' === $this->processId) {
$this->route->setParameter(
ResourceRegistrar::PARAM_PROCESS_ID,
$store->findOrFail($this->getProcessType(), $this->processId)
Expand Down