Skip to content

Commit

Permalink
fix for multiple "Exception: Moodle exception: Exception - Call to a …
Browse files Browse the repository at this point in the history
…member function export_for_template() on array" (related to Wunderbyte-GmbH@2ac9de1) (Wunderbyte-GmbH#807)
  • Loading branch information
semteacher committed Jan 18, 2025
1 parent 6f65000 commit bf34bce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/booking_bookit.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ public static function render_bookit_template_data(
if ($showprepagemodal) {
// We render the button only from the highest relevant blocking condition.

$data = (array)new prepagemodal(
$data = new prepagemodal(
$settings, // We pass on the optionid.
count($prepages), // The total number of pre booking pages.
$buttoncondition, // This is the button we need to render twice.
!$justmyalert ? $extrabuttoncondition : '', // There might be a second button to render.
$userid, // The userid for which all this will be rendered.
);

$data['results'] = json_encode(array_keys($results));
$data->results = json_encode(array_keys($results));

$datas[] = $data;

Expand Down
2 changes: 2 additions & 0 deletions classes/output/prepagemodal.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class prepagemodal implements renderable, templatable {
/** @var string $inmodalbuttonhtml */
public $inmodalbuttonhtml = "";

/** @var string $results */
public $results = "";
/**
* Constructor
*
Expand Down

0 comments on commit bf34bce

Please sign in to comment.