Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:31:24+00:00 2026-06-10T11:31:24+00:00

in the silverstripe backend I´m managing certain PageTypes via a ModelAdmin. That works fine

  • 0

in the silverstripe backend I´m managing certain PageTypes via a ModelAdmin. That works fine so far, the only thing i can´t figure out is how to make a Page being “Published” when saving it.

Thats my code:

class ProjectPage extends Page { 
    public function onAfterWrite() {
        $this->doPublish();
        parent::onAfterWrite();
    }
}

At the moment I can still see the ModelAdmin-created Pages in the Sitetree and I can see they are in Draft Mode. If I use the code above I get this error:
Maximum execution time of 30 seconds exceeded in
…/framework/model/DataList.php

Many thx,
Florian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:31:26+00:00Added an answer on June 10, 2026 at 11:31 am

    the reason why you get “Maximum execution time exceeded” is because $this->doPublish(); calls $this->write(); which then calls $this->onAfterWrite();. And there you have your endless loop.
    So doing this in onAfterWrite() or write() doesn’t really work

    you should just display the save & publish button instead of the save button
    But I guess its easier said than done.
    Well adding a button is actually just a few lines, but we also need a provide the functions that do what the button says it does.

    This sounds like the perfect call for creating a new Module that allows proper handling of Pages in model admin. I have done this in SS2.4, and I have a pretty good idea of how to do it in SS3, but no time this week, poke me on the silverstripe irc channel on the weekend, maybe I have time on the weekend.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SilverStripe 3, How can I put multiline comments in template file ?
I have a textareaField in Silverstripe Backend in Edit Page View... The text to
Using SilverStripe 2.4.7. I've done some searching but I can't seem to be able
Basically what I want to do is to create a SilverStripe CMS that allows
Is anyone able to tell me how to write a function that can intercept
I'm using SilverStripe 2.4.7 and I want to add a method that parses the
I'm building a single page portfolio with SilverStripe. So far I am able to
I am looking to attach multiple images to a page in silverstripe (that will
Silverstripe is running on my since a few weeks. Recently, I get an Internal
Currently I am working on a SilverStripe project, and everything seems to be running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.