From c75969ca90b688ad46b4c76b1f98a89c9163688c Mon Sep 17 00:00:00 2001 From: Steve Joynt Date: Tue, 26 Nov 2024 11:19:07 +1100 Subject: [PATCH] FIX Allow for custom admin route (#1281) Fixes an issue saving inline editable content blocks if a custom admin route was set --- src/Controllers/ElementalAreaController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controllers/ElementalAreaController.php b/src/Controllers/ElementalAreaController.php index 3a208e5c..4626fc3c 100644 --- a/src/Controllers/ElementalAreaController.php +++ b/src/Controllers/ElementalAreaController.php @@ -5,6 +5,7 @@ use DNADesign\Elemental\Forms\EditFormFactory; use DNADesign\Elemental\Models\BaseElement; use DNADesign\Elemental\Services\ElementTypeRegistry; +use SilverStripe\Admin\AdminRootController; use SilverStripe\CMS\Controllers\CMSMain; use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; @@ -240,7 +241,7 @@ private function createElementForm(BaseElement $element): Form ); $urlSegment = $this->config()->get('url_segment'); - $form->setFormAction("admin/$urlSegment/elementForm/$id"); + $form->setFormAction(AdminRootController::admin_url("$urlSegment/elementForm/$id")); if (!$element->canEdit()) { $form->makeReadonly();