Commit b433c22b authored by Lisa Seeto's avatar Lisa Seeto
Browse files

Bug 1897676: Entire resume block - debug information displayed

 NB: We are ignoring the multiple records found warnings
 that are produced as a result of asynch json calls until we can
 refactor that part of the code

 - add IGNORE_MULTIPLE flag to ensure_record_exists
 - remove old param comment

Change-Id: I39548cd157c9c2bfe82450bfddbe33696233a974
Signed-off-by: default avatarLisa Seeto <>
parent 58883999
......@@ -134,7 +134,9 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
'artefact' => $artefact->id,
'block' => $blockinstance->get('id'),
ensure_record_exists('view_artefact', $record, $record);
/* There are multiple calls to the DB via asynch json calls causing multiple records to be created
* * until that issue is fixed, we ignore the warnigns for now */
ensure_record_exists('view_artefact', $record, $record, false, false , IGNORE_MULTIPLE);
......@@ -200,8 +200,6 @@ class ArtefactTypeResume extends ArtefactType {
* Overrides the default commit to make sure that any 'entireresume' blocks
* in views the user have know about this artefact - but only if necessary.
* Goals and skills are not in the entireresume block
* @param boolean $updateresumeblocks Whether to update any resume blockinstances
public function commit() {
......@@ -1318,9 +1318,12 @@ function pseudo_trigger($table, $data, $id, $savetype = 'insert') {
* @param array $dataobject A data object with values for one or more fields in the record (to be inserted or updated)
* @param string $primarykey The primary key of the table we are inserting into (almost always "id")
* @param bool $returnpk Should the id of the newly created record entry be returned? If this option is not requested then true/false is returned.
* @param int $strictness IGNORE_MULITPLE means no special action if multiple records found
* WARN_MULTIPLE means log a warning message if multiple records found
* ERROR_MULTIPLE means we will throw an exception if multiple records found.
* @throws SQLException
function ensure_record_exists($table, $whereobject, $dataobject, $primarykey=false, $returnpk=false) {
function ensure_record_exists($table, $whereobject, $dataobject, $primarykey=false, $returnpk=false, $strictness=WARN_MULTIPLE) {
$columns = (array)$whereobject;
$where = array();
$values = array();
......@@ -1345,7 +1348,7 @@ function ensure_record_exists($table, $whereobject, $dataobject, $primarykey=fal
if ($exists = get_record_select($table, $where, $values)) {
if ($exists = get_record_select($table, $where, $values, '*' , $strictness)) {
if ($returnpk) {
$toreturn = $exists->{$primarykey};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment