Commit 55d3b300 authored by ZeMKI's avatar ZeMKI
Browse files

Update StudyController.php

* bugfix on duplicate study: when you duplicate and you have an interview with a created token, now it's not duplicated (caused errors)
parent 8d47d7c0
......@@ -21,6 +21,7 @@ use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use Image;
use Storage;
......@@ -81,6 +82,13 @@ class StudyController extends Controller
} else if ($relationName == "tokens") {
foreach($values as $index => $token ) {
if($token->author == 0) {
unset($values[$index]);
}
}
$copy->{$relationName}()->attach($values);
}
}
......
Supports Markdown
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