Skip to content

Commit

Permalink
Fix database error
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Nov 23, 2021
1 parent ea79a0e commit 1d2b5b8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.5.13

* Fix database error when cache is being cleared before installation of plugin.

## 2.5.12

* Fix strpos() type error.
Expand Down
20 changes: 14 additions & 6 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,13 @@ private function registerEventListeners(): void
* When one or more redirects have been changed.
*/
Event::listen('vdlp.redirect.changed', static function (array $redirectIds): void {
/** @var PublishManagerInterface $publishManager */
$publishManager = resolve(PublishManagerInterface::class);
$publishManager->publish();
try {
/** @var PublishManagerInterface $publishManager */
$publishManager = resolve(PublishManagerInterface::class);
$publishManager->publish();
} catch (Throwable $throwable) {
// @ignoreException
}
});

/*
Expand All @@ -376,9 +380,13 @@ private function registerEventListeners(): void
* Re-publish all redirect if cache has been cleared.
*/
Event::listen('cache:cleared', static function (): void {
/** @var PublishManagerInterface $publishManager */
$publishManager = resolve(PublishManagerInterface::class);
$publishManager->publish();
try {
/** @var PublishManagerInterface $publishManager */
$publishManager = resolve(PublishManagerInterface::class);
$publishManager->publish();
} catch (Throwable $throwable) {
// @ignoreException
}
});
}
}
2 changes: 2 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@
- "Minor fixes -- See: https://github.com/vdlp/oc-redirect-plugin/releases/tag/2.5.11"
2.5.12:
- "Fix strpos() type error"
2.5.13:
- "Fix database error when cache is being cleared before installation of plugin."

0 comments on commit 1d2b5b8

Please sign in to comment.