Skip to content

Commit

Permalink
Merge 059acd9 into 9653430
Browse files Browse the repository at this point in the history
  • Loading branch information
vpeil committed Oct 31, 2019
2 parents 9653430 + 059acd9 commit 93b2795
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/LibreCat/App/Catalogue/Route/publication.pm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Checks if the user has the rights to update this record.
else {
librecat->log->warnf(
"receiving an unknown finalSubmit `%s` from the form"
, $params->{finalSubmit}
, $params->{finalSubmit}
);
}

Expand Down Expand Up @@ -443,8 +443,13 @@ Clones the record with ID :id and returns a form with a different ID.
{message => "No publication found with ID $id."};
}

delete $rec->{_version};
delete $rec->{date_created};
delete $rec->{date_updated};
delete $rec->{doi};
delete $rec->{file};
delete $rec->{related_material};

$rec->{_id} = publication->generate_id;
$rec->{new_record} = 1;

Expand Down
24 changes: 22 additions & 2 deletions t/www/edit_record.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,30 @@ note("edit 2737383");
finalSubmit => "recSave"
},
},
'submitting the login form'
'submitting the edit form'
);

$mech->content_contains("(Admin)", "logged in successfully");
$mech->content_contains("(Admin)", "back on dashboard");
}

note("clone 2737383");
{
$mech->get_ok('/librecat/record/clone/2737383');

$mech->has_tag('h1',
'Function of glutathione peroxidases in legume root nodules');

$mech->submit_form_ok(
{
form_id => 'edit_form',
fields => {
finalSubmit => "recSave"
},
},
'submitting the edit form after cloning'
);

$mech->content_contains("(Admin)", "back on dashboard");
}

done_testing;

0 comments on commit 93b2795

Please sign in to comment.