Fixed nulled organisation name

This commit is contained in:
2022-02-15 15:49:47 +00:00
parent d31bdd9970
commit abe208bc50
2 changed files with 9 additions and 9 deletions

View File

@@ -359,10 +359,10 @@ class OrganisationController extends SimpleController
throw new NotFoundException();
}
// Begin transaction - DB will be rolled back if an exception occurs
Capsule::transaction(function () use ($source, $target, $currentUser) {
$sourceName = $source->name;
$sourceName = $source->name;
// Begin transaction - DB will be rolled back if an exception occurs
Capsule::transaction(function () use ($source, $target, $currentUser, $sourceName) {
$this->ci->get('organisation.beforeMerge')($source, $target);
$source->beforeMerge($target, ['currentUser' => $currentUser]);
@@ -431,10 +431,10 @@ class OrganisationController extends SimpleController
throw new ForbiddenException();
}
// Begin transaction - DB will be rolled back if an exception occurs
Capsule::transaction(function () use ($organisation, $currentUser) {
$organisationName = $organisation->name;
$organisationName = $organisation->name;
// Begin transaction - DB will be rolled back if an exception occurs
Capsule::transaction(function () use ($organisation, $currentUser, $organisationName) {
// Delete the organisation (soft)
$organisation->delete();
unset($organisation);