Skip to content

Commit

Permalink
Merge pull request #1282 from PortableSteve/custom-admin-route-fix
Browse files Browse the repository at this point in the history
FIX: Allow for custom admin url
GuySartorelli authored Nov 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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
@@ -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();

0 comments on commit 6d0fb1e

Please sign in to comment.