Skip to content

Commit

Permalink
Improvement: Delete unnecessary step in booking option creation #807
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Jan 18, 2025
1 parent 14cce30 commit a7619c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function create_option($record = null) {
// Finalizing object with required properties.
$record->id = 0;
$record->cmid = $booking->cmid;
$record->identifier = booking_option::create_truly_unique_option_identifier();
$record->identifier = $record->identifier ?? booking_option::create_truly_unique_option_identifier();

$context = context_module::instance($record->cmid);

Expand All @@ -171,12 +171,12 @@ public function create_option($record = null) {

// Create / save booking option(s).
if ($record->id = booking_option::update($record, $context)) {
$record->optionid = $record->id;
//$record->optionid = $record->id;

// Add price (via API).
$price = new Mod_bookingPrice('option', $record->id);
$price->set_data($record);
booking_option::update($record, $context);
// $price = new Mod_bookingPrice('option', $record->id);
// $price->set_data($record);
// booking_option::update($record, $context);
}

return $record;
Expand Down

0 comments on commit a7619c5

Please sign in to comment.