Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Search in blog does not work

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 2204 Views
  • Mikle
    Avatar
    Community Member
    1 Post

    Search in blog does not work Link to this post

    After click on the search button in blog I have got next : "Action 'SearchForm' isn't allowed on class BlogHolder_Controller".
    In order to fix a little bug you should add 'SeachForm' to $allowed_actions array in BlogHolder.php

    static $allowed_actions = array(
          'postblog' => 'BLOGMANAGEMENT',
          'post' => 'BLOGMANAGEMENT',
          'BlogEntryForm' => 'BLOGMANAGEMENT',
          'rss',
          'tag',
          'showarchive',
          'SearchForm',

       );

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Search in blog does not work Link to this post

    Hey Mikle,

    You might like to add this to open.silverstripe.org as a ticket (if it isn't already) so that the core devs can track the issue and get the fix into the module

  • ajshort
    Avatar
    Community Member
    244 Posts

    Re: Search in blog does not work Link to this post

    Actually, the default Page type should have SearchForm added to its $allowed_actions, and BlogHolder will just pick this up.

  • Silversurver
    Avatar
    Community Member
    1 Post

    Re: Search in blog does not work Link to this post

    Hello,
    it works ;-)
    Thank you, it helps me a lot.

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Search in blog does not work Link to this post

    just to make this a little more clear to newbies could someone please tell us exactly what to add
    to our mysite/code/Page.php I believe it will be right before the init method of your controller.

    I have tried this..

    class Page_Controller extends ContentController {
       
       static $allowed_actions = array(
    'SearchForm',

    );
       
       public function init() {

    How ever it seemed to cause a problem adding new posts from the blog page. I have since opted for the cade sample provided for the BlogHolder.php

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: Search in blog does not work Link to this post

    I still have a problem that I believe is related.
    I have used the code to solve the search issue as shown early in this thread.
    I now have a problem with the 'Post a new blog entry' link shown when viewing a post. (BlogEntry)
    When I click to post a new blog I receive this error: Action 'post' isn't allowed on class BlogHolder_Controller
    It seems to be a related issue since the error is similar, however there is a 'post' entry already.
    Anyone else come across this? I have tried the latest build but it won't install for me.

    2204 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.