Skip to content

Commit

Permalink
fix for "Debugging: Event property objectid must be set when objectta…
Browse files Browse the repository at this point in the history
…ble is defined"
  • Loading branch information
semteacher committed Oct 13, 2024
1 parent 9af6918 commit 9d67384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/external/get_config_for_js.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ public static function execute(string $component, string $paymentarea, int $item

// Check for duplicate.
if (!$existingrecord = $DB->get_record('paygw_mpay24_openorders', ['itemid' => $itemid, 'userid' => $USER->id])) {
$DB->insert_record('paygw_mpay24_openorders', $record);
$id = $DB->insert_record('paygw_mpay24_openorders', $record);

// We trigger the payment_added event.
$context = context_system::instance();
$event = payment_added::create([
'context' => $context,
'userid' => $USER->id,
'objectid' => $id,
'other' => [
'orderid' => $merchanttransactionid,
],
Expand Down

0 comments on commit 9d67384

Please sign in to comment.