Skip to content

Commit

Permalink
fix: prevent auto-install of RockPageBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Nov 22, 2023
1 parent 52854dd commit 07b1418
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions RockFrontend.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,9 @@ public function alfred($page = null, $options = [])
$opt->setArray($options);

// add quick-add-icons for rockpagebuilder
if ($rpb = $this->wire->modules->get("RockPageBuilder")) {
if ($this->wire->modules->isInstalled('RockPageBuilder')) {
/** @var RockPageBuilder $rpb */
$rpb = $this->wire->modules->get("RockPageBuilder");
$data = $this->wire(new WireData());
$data->page = $page;
$data->opt = $opt;
Expand Down Expand Up @@ -905,7 +906,10 @@ public function ___getIcons($page, $opt)

// add rockpagebuilder icons
if ($page) {
$rpb = $this->wire->modules->get("RockPageBuilder");
$rpb = false;
if ($this->wire->modules->isInstalled('RockPageBuilder')) {
$rpb = $this->wire->modules->get("RockPageBuilder");
}
if ($page instanceof Block) $page->addAlfredIcons($icons, $opt);
elseif ($page instanceof RepeaterPage and $rpb) {
$rpb->addAlfredIcons($page, $icons, $opt);
Expand Down

0 comments on commit 07b1418

Please sign in to comment.