diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2022-05-13 14:23:21 +0100 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2022-05-13 14:23:21 +0100 |
| commit | a92a07c79bdf61915fb2107b92a9eaae1d2f2d04 (patch) | |
| tree | 1497dbf8f379f1b5ba30558feda3b69488255479 /app/Http/RequestHandlers/AddChildToFamilyAction.php | |
| parent | e4ce91ea2aa613a20379db5651de7024c7f91a55 (diff) | |
| download | webtrees-a92a07c79bdf61915fb2107b92a9eaae1d2f2d04.tar.gz webtrees-a92a07c79bdf61915fb2107b92a9eaae1d2f2d04.tar.bz2 webtrees-a92a07c79bdf61915fb2107b92a9eaae1d2f2d04.zip | |
Use Validator class
Diffstat (limited to 'app/Http/RequestHandlers/AddChildToFamilyAction.php')
| -rw-r--r-- | app/Http/RequestHandlers/AddChildToFamilyAction.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Http/RequestHandlers/AddChildToFamilyAction.php b/app/Http/RequestHandlers/AddChildToFamilyAction.php index 1e2d80b629..59a5d927bb 100644 --- a/app/Http/RequestHandlers/AddChildToFamilyAction.php +++ b/app/Http/RequestHandlers/AddChildToFamilyAction.php @@ -56,16 +56,16 @@ class AddChildToFamilyAction implements RequestHandlerInterface { $tree = Validator::attributes($request)->tree(); $xref = Validator::attributes($request)->isXref()->string('xref'); - $params = (array) $request->getParsedBody(); $family = Registry::familyFactory()->make($xref, $tree); $family = Auth::checkFamilyAccess($family, true); - $levels = $params['ilevels'] ?? []; - $tags = $params['itags'] ?? []; - $values = $params['ivalues'] ?? []; + + $levels = Validator::parsedBody($request)->array('ilevels'); + $tags = Validator::parsedBody($request)->array('itags'); + $values = Validator::parsedBody($request)->array('ivalues'); + $gedcom = $this->gedcom_edit_service->editLinesToGedcom(Individual::RECORD_TYPE, $levels, $tags, $values); // Create the new child - $gedcom = "0 @@ INDI\n1 FAMC @" . $xref . '@' . $this->gedcom_edit_service->editLinesToGedcom(Individual::RECORD_TYPE, $levels, $tags, $values); - $child = $tree->createIndividual($gedcom); + $child = $tree->createIndividual("0 @@ INDI\n1 FAMC @" . $xref . '@' . $gedcom); // Link the child to the family $family->createFact('1 CHIL @' . $child->xref() . '@', false); |
