Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Think they'll accept a patch for this?


Go to End


4 Posts   1678 Views

Avatar
brianmwaters

Community Member, 5 Posts

24 March 2011 at 7:18am

Edited: 24/03/2011 7:25am

I'm still waiting for my membership to the development mailing list to clear, so in the meantime I'll ask this here. It's probably better anyway.

Currently, when you run /dev/build, a bunch of default pages like "Home" and "Page not found" are created. Some add-on modules create default pages too. This is annoying if you don't want those pages, or if you want them to be called something else.

If the user has SiteTree::set_default_pages(false) in their _config.php, the "Home" page doesn't get created, but the others do. This is because SiteTree::requireDefaultRecords() checks to see if SiteTree::$create_default_pages is set, but others can't, since that member is private.

Clearly, if the user calls SiteTree::set_default_pages(false), then they don't want any default pages to be created.

In order to fix this, we have to create a SiteTree::get_default_pages() method, and add checks to a few requireDefaultRecords() methods. Add-on modules should probably add these checks in the future, but they'll break compatibility with old versions of SilverStripe if they do.

This patch will only take about 20 minutes of work, but as there is a potential compatibility break if add-on modules adapt it, I'd like to hear what people's thoughts are before I go through the trouble of submitting it. I guess this will have to go into SilverStripe 2.5. Is that release even in the works, or will the next non-minor release be 3.0? If I do this patch, what branch should I do it against?

Thanks!

- Brian Waters

Avatar
swaiba

Forum Moderator, 1899 Posts

24 March 2011 at 7:56am

Hi Brian,

Welcome! while this and the dev list are places to discuss this what you are saying sounds very straightforward. I'd advise you to goto open.silverstirpe.org and raise a ticket and indicate your fix - it's the quickest way to get in contact with the devs and find out what they think of your patch.

Barry

Avatar
brianmwaters

Community Member, 5 Posts

24 March 2011 at 8:06am

Thanks!!!

I think I'll copy this over almost verbatim now...

- BW

Avatar
Willr

Forum Moderator, 5523 Posts

24 March 2011 at 8:45pm

Hi Brian,

We're not accepting patches for features in the 2.4 branch any more (that's going to be limited to security releases from now) so you should be working on any new functionality on master - https://github.com/silverstripe/sapphire. Fork that repository and submit your patches as pull requests.

http://doc.silverstripe.org/sapphire/en/misc/contributing#submiting-patches-bugfixes-and-enhancements

Cheers,