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(); 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); $this->ci->get('organisation.beforeMerge')($source, $target);
$source->beforeMerge($target, ['currentUser' => $currentUser]); $source->beforeMerge($target, ['currentUser' => $currentUser]);
@@ -431,10 +431,10 @@ class OrganisationController extends SimpleController
throw new ForbiddenException(); 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) // Delete the organisation (soft)
$organisation->delete(); $organisation->delete();
unset($organisation); unset($organisation);

View File

@@ -206,10 +206,10 @@ class OrganisationRegistrationController extends SimpleController
throw new ForbiddenException(); 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 // Delete the organisation
$organisation->delete(true); $organisation->delete(true);
unset($organisation); unset($organisation);