We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e5e1f3 commit 3e8802fCopy full SHA for 3e8802f
1 file changed
src/Entries/Entry.php
@@ -169,7 +169,11 @@ public function livePreviewUrl()
169
170
protected function cpUrl($route)
171
{
172
- return cp_route($route, [$this->collectionHandle(), $this->id(), $this->slug()]);
+ if (! $id = $this->id()) {
173
+ return null;
174
+ }
175
+
176
+ return cp_route($route, [$this->collectionHandle(), $id, $this->slug()]);
177
}
178
179
public function apiUrl()
@@ -484,7 +488,11 @@ public function parent()
484
488
return null;
485
489
486
490
487
- return $this->structure()->in($this->locale())->page($this->id())->parent();
491
492
493
494
495
+ return $this->structure()->in($this->locale())->page($id)->parent();
496
497
498
public function route()
0 commit comments