Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ function argOrNull($key)
return $this->has_arg($key) ? $this->arg($key) : null;
}

function argIfNotEmptyString($key)
{
return $this->has_arg($key) && $this->arg($key) !== '' ? $this->arg($key) : null;
}

# ------------------------------------------------------------------------
# Misc Helpers

Expand Down
6 changes: 3 additions & 3 deletions api/src/Page/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2607,8 +2607,8 @@ function _add_container()
$tem = $this->has_arg('STORAGETEMPERATURE') ? $this->arg('STORAGETEMPERATURE') : null;

$crid = $this->has_arg('CONTAINERREGISTRYID') ? $this->arg('CONTAINERREGISTRYID') : null;
$pcid = $this->has_arg('PARENTCONTAINERID') ? $this->arg('PARENTCONTAINERID') : null;
$pcl = $this->has_arg('PARENTCONTAINERLOCATION') ? $this->arg('PARENTCONTAINERLOCATION') : null;
$pcid = $this->argIfNotEmptyString('PARENTCONTAINERID');
$pcl = $this->argIfNotEmptyString('PARENTCONTAINERLOCATION');

$pipeline = $this->has_arg('PROCESSINGPIPELINEID') ? $this->arg('PROCESSINGPIPELINEID') : null;
$source = $this->has_arg('SOURCE') ? $this->arg('SOURCE') : null;
Expand Down Expand Up @@ -2640,7 +2640,7 @@ function _add_container()
if ($e->getCode() == 1062) {
$this->_error('Barcode is not unique. Please enter a different barcode.', 409);
} else {
$this->_error('An unexpected error occurred.', 500);
$this->_error('An unexpected error occurred: ' . $e->getMessage(), 500);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ export default {
this.NAME = ''
this.BARCODE = ''
this.CONTAINERREGISTRYID = ''
this.PARENTCONTAINERID = ''
this.PARENTCONTAINERLOCATION = ''
this.PARENTCONTAINERID = null
this.PARENTCONTAINERLOCATION = null
// Trigger default setting of UDC fields if selected
this.selectQueueForUDC(this.AUTOMATED)

Expand Down
Loading