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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Blog Module /

Discuss the Blog Module.

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

Action '2009' isn't allowed on class BlogHolder_Controller


Go to End


15 Posts   6482 Views

Avatar
steve_nyhof

Community Member, 224 Posts

19 November 2009 at 4:37pm

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

Community Member, 55 Posts

19 November 2009 at 4:44pm

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

Community Member, 224 Posts

19 November 2009 at 5:26pm

Edited: 19/11/2009 5:28pm

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

Community Member, 55 Posts

19 November 2009 at 5:29pm

good stuff :)

Avatar
timwjohn

Community Member, 98 Posts

25 November 2009 at 6:50am

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

Community Member, 28 Posts

27 November 2009 at 9:04am

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

Community Member, 98 Posts

28 November 2009 at 2:23am

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

Go to Top