Skip to content

Commit

Permalink
FIX Allow for custom admin route (silverstripe#1281)
Browse files Browse the repository at this point in the history
Fixes an issue saving inline editable content blocks if a custom admin route was set
  • Loading branch information
PortableSteve committed Nov 26, 2024
1 parent 23af9c0 commit c75969c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Controllers/ElementalAreaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit c75969c

Please sign in to comment.