Skip to content

Commit

Permalink
fix: fixes issue with CreationFieldSyncController in Nova 4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrobertsFF committed Oct 26, 2022
1 parent d642f49 commit ba351a8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Http/Middleware/InterceptDependentFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Laravel\Nova\Fields\FieldCollection;
use Laravel\Nova\Http\Controllers\UpdateFieldController;
use Laravel\Nova\Http\Controllers\CreationFieldController;
use Laravel\Nova\Http\Controllers\CreationFieldSyncController;
use Laravel\Nova\Http\Controllers\UpdatePivotFieldController;
use Laravel\Nova\Http\Controllers\CreationPivotFieldController;
use Laravel\Nova\Http\Requests\NovaRequest;
Expand Down Expand Up @@ -54,15 +55,7 @@ protected function isDependentFieldRequest(Request $request) {
if (!$request->isMethod("PATCH")) {
return false;
}
$routeController = $request->route()->getController();
if ($routeController && ($routeController instanceof UpdateFieldController ||
$routeController instanceof CreationFieldController ||
$routeController instanceof UpdatePivotFieldController ||
$routeController instanceof CreationPivotFieldController
)) {
return true;
}
return false;
return (is_null($this->getFieldMethod($request))) ? false : true;
}

protected function hasDependentPanelFields(Request $request) {
Expand Down Expand Up @@ -111,6 +104,7 @@ protected function getFieldMethod(Request $request) {
case UpdatePivotFieldController::class:
return "updatePivotFields";
case CreationFieldController::class:
case CreationFieldSyncController::class:
return "creationFields";
case CreationPivotFieldController::class:
return "creationPivotFields";
Expand Down

0 comments on commit ba351a8

Please sign in to comment.