Skip to content

Commit d074603

Browse files
committed
Fixed issue with draft pages pinging the incorrect URL.
1 parent 28a5ece commit d074603

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Helpers/UpdateServiceNotifier.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ public function shouldLog()
7979
public function listen()
8080
{
8181
if ($this->hasValidConfiguration()) {
82+
8283
Events::addListener('on_page_version_approve', function($event) {
83-
$page_id = $event->getCollectionVersionObject()->getCollectionID();
84-
$page = Page::getById($page_id);
84+
$page = $event->getPageObject();
85+
if (! $page->isPageDraft()) {
86+
$this->pingPage($page);
87+
}
88+
});
89+
90+
Events::addListener('on_page_type_publish', function($event) {
91+
$page = $event->getPageObject();
8592
$this->pingPage($page);
8693
});
8794
}

0 commit comments

Comments
 (0)