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.

Blog Module

Discuss the Blog Module.

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

Action '2009' isn't allowed on class BlogHolder_Controller


Reply

15 Posts   4836 Views

Avatar
steve_nyhof

19 November 2009 at 4:37pm Community Member, 224 Posts

I have tried adding the code mentioned in the BlogHolder.php file as a function and it does not work for me. David, can you elaborate on what you mean put it in the BlogHolder_Controller class - I tried that also and didn't work. Can you provide the code please?

Avatar
david_nash

19 November 2009 at 4:44pm Community Member, 55 Posts

Hi Steve

in blog/code/BlogHolder.php look for

class BlogHolder_Controller extends Page_Controller {

Under that the static $allowed_actions is defined. The you should see the init() function. Below that function I pasted

//fix the broken archives
function checkAccessAction($action) {
if (preg_match('/[0-9]{4}/', $action))
{
return true;
}
return parent::checkAccessAction($action);
}

Which worked for me.

Avatar
steve_nyhof

19 November 2009 at 5:26pm (Last edited: 19 November 2009 5:28pm), Community Member, 224 Posts

I think that is working. I just realized that I only just wrote a few posts this month, so it is showing only this month - I think it worked, thank you!

Edit: I changed the date on one and tested, worked perfectly!

Avatar
david_nash

19 November 2009 at 5:29pm Community Member, 55 Posts

good stuff :)

Avatar
timwjohn

25 November 2009 at 6:50am Community Member, 98 Posts

I have the latest trunk and the same problem.

Here's a temporary solution that doesn't involve hacking the module code. Put this line in mysite/_config.php:

BlogHolder_Controller::$allowed_actions[] = '2009';

... and for any other years in which blog posts were made.

Hopefully, by 2010 this issue will have been solved!

Avatar
SightUnseen

27 November 2009 at 9:04am Community Member, 28 Posts

Does anyone know if this is the same as the issue we have here: http://silverstripe.org/blog-module-forum/show/269745#post269745 ?

We've tried various fixes and no success so far.

Avatar
timwjohn

28 November 2009 at 2:23am Community Member, 98 Posts

It could be. If it is, the above code should fix it...