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.

Forum Module /

Discuss the Forum Module.

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

Forum module in SilverStripe 3.1 beta


Reply


3 Posts   1522 Views

Avatar
Josua

Community Member, 86 Posts

25 January 2013 at 12:00am

Hi all!

The forum module work with Silverstripe 3.1 beta?
It produces errors:
Fatal error: Class declarations may not be nested in C:\wamp\www\forum\code\ForumHolder.php on line 227 (SilverStripe 3.1 beta from github)
[User Error] Couldn't find field GroupID in any of Member's tables (SS 3.1 beta from github)

Somebody has tried it with SS 3.1?

Is there any fix?

Thanks,
Regards,
Jose A.

Avatar
Tony Air

Community Member, 13 Posts

4 February 2013 at 11:35pm

Edited: 05/02/2013 6:53am

The same issue
fast and dirty solution is to replace 2 functions in ForumHolder.php

CurrentlyOnline()

function CurrentlyOnline() {
      $groupIDs = array();
      $where = '';
      if($forumGroup = Group::get()->filter('Code', 'forum-members')->first()) {
         //$groupIDs[] = $forumGroup->ID;
         $where .= ' "GroupID" = \''.$forumGroup->ID.'\'';
      }

      if($adminGroup = Group::get()->filter('Code', array('administrators', 'Administrators'))->first()) {
         //$groupIDs[] = $adminGroup->ID;
         if($where!=='') {$where .= ' OR';}
         $where .= ' "GroupID" = \''.$adminGroup->ID.'\'';
      }

      return Member::get()
         ->leftJoin('Group_Members', 'Member.ID = Group_Members.MemberID')
         ->where($where)
         //->filter('GroupID', $groupIDs)
         ->filter("LastViewed:GreaterThan", DB::getConn()->datetimeIntervalClause('NOW', '-15 MINUTE'))
         ->sort('Member.FirstName, Member.Surname');
   }

and getLatestMembers()

function getLatestMembers($limit = 1) {
      $groupIDs = array();
      $where = '';
      if($forumGroup = Group::get()->filter('Code', 'forum-members')->first()) {
         //$groupIDs[] = $forumGroup->ID;
         $where .= ' "GroupID" = \''.$forumGroup->ID.'\'';
      }
      if($adminGroup = Group::get()->filter('Code', array('administrators','Administrators'))->first()) {      
         //$groupIDs[] = $adminGroup->ID;
         if($where!=='') {$where .= ' OR';}
         $where .= ' "GroupID" = \''.$adminGroup->ID.'\'';
      }
      
      $latestMembers = Member::get()
         ->leftJoin('Group_Members', 'Member.ID = Group_Members.MemberID')
         ->where($where)
         //->filter('GroupID', $groupIDs)
         ->sort('Member.ID DESC')
         ->limit($limit);

      return $latestMembers;
   }

Avatar
Platypus

Community Member, 43 Posts

24 April 2013 at 4:15am

Thanks for this hint, it helped me very much with SS 3.1 and the forums module.