Skip to content

Commit

Permalink
Merge pull request silverstripe#1282 from PortableSteve/custom-admin-…
Browse files Browse the repository at this point in the history
…route-fix

FIX: Allow for custom admin url
  • Loading branch information
GuySartorelli authored Nov 26, 2024
2 parents 23af9c0 + c75969c commit 6d0fb1e
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 6d0fb1e

Please sign in to comment.