Search code examples
phpsilverstripesilverstripe-4

Silverstripe Elemental Module redirects to frontend 404 page on element save


I use dnadesign/silverstripe-elemental 2.x-dev, and Silverstripe 4.0.1.

I created a module for page to hold all pages. This is how i added the extension to HomePage.

    XYPage\Model\HomePage:
      extensions: 
        - DNADesign\Elemental\Extensions\ElementalPageExtension

This is my HomePageController:

    namespace XYpage\Controller;

    use PageController;

    class HomePageController extends PageController
    {
    }

This is my HomePageModel:

    namespace XYpage\Model;

    use Page;
    use XYpage\Controller\HomePageController;
    class HomePage extends Page
    {

     private static $table_name = 'HomePage';

     /**
     * As our controller resides in a different namespace we have to 
     overwrite this method
     *
     * @return string
     */
     public function getControllerName()
     {
      return HomePageController::class;
     }
    }

I changed the template variable to $ElementalArea. I see the expected UI in the BackEnd.

Now if i save an single element in the backend i always get redirected into the front-end to the 404 Page.

When i switch back to the Backend the element is linked to the page.

If i fill in content to the WYSIWYG editor on the Content Element and save it the content gets displayed on the page in the frontend.

If i try to edit that element misses the WYSIWYG editor for the content.

I tried hard to fix this, red the docs but i don´t see what i did wrong.


Solution

  • There is an issue with BetterButtons & DNADesign Elemental.

    Just add this to disable BetterButtons for ElementContent in the meantime.

    DNADesign\Elemental\Models\ElementContent:
      better_buttons_enabled: false