Jump to:

1036 Posts in 810 Topics by 315 members

Forum Module

SilverStripe Forums » Forum Module » Forum Trunk API Changes

Discuss the Forum Module.

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

Page: 1 2 3
Go to End
Author Topic: 4790 Views
  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Thanks for this new update of the forum module, that was one area about which I had some worries, seems to be making good progress now. So now I'm testing forum trunk, using the forum trunk templates.

    SS 2.4 beta, latest trunk of forum module forum-trunk-r101555.tar.gz :

    After running migration most functions work. What does not work is new registrations, when clicking on registration this error happens:

    [User Error] Uncaught Exception: Object->__call(): the method 'forumholder' does not exist on 'ForumMemberProfile'
    GET /ForumMemberProfile/register

    Line 620 in /.....l/mydomain.com/htdocs/sapphire/core/Object.php
    Source
    611             
    612             default :
    613                throw new Exception (
    614                   "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config, true)
    615                );
    616          }
    617       } else {
    618          // Please do not change the exception code number below.
    619          
    620          throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'", 2175);
    621       }
    622    }
    623    
    624    // -----------------------------------------------------------------------------------------------------------------
    625    
    626    /**
    Trace
    Object->__call(ForumHolder,Array)
    ForumMemberProfile->ForumHolder()
    Line 593 of ForumMemberProfile.php
    ForumMemberProfile->URLSegment()
    Line 382 of ViewableData.php
    ViewableData->obj(URLSegment,,,1,)
    Line 839 of ViewableData.php
    ViewableData_Customised->obj(URLSegment,,,1,)
    Line 839 of ViewableData.php
    ViewableData_Customised->obj(URLSegment,,,1)
    Line 458 of ViewableData.php
    ViewableData->XML_val(URLSegment,,1)
    Line 33 of .cache.srv.www.virtual.mydomain.com.htdocs.themes.SchwedenGate.templates.Page.ss
    include(/...../mydomain.com/htdocs/silverstripe-cache/.cache.srv.www.virtual.mydomain.com.htdocs.themes.SchwedenGate.templates.Page.ss)
    Line 377 of SSViewer.php
    SSViewer->process(ViewableData_Customised)
    Line 197 of Controller.php
    Controller->handleAction(SS_HTTPRequest)
    Line 135 of RequestHandler.php
    RequestHandler->handleRequest(SS_HTTPRequest)
    Line 147 of Controller.php
    Controller->handleRequest(SS_HTTPRequest)
    Line 160 of ContentController.php
    ContentController->handleRequest(SS_HTTPRequest)
    Line 283 of Director.php
    Director::handleRequest(SS_HTTPRequest,Session)
    Line 127 of Director.php
    Director::direct(/ForumMemberProfile/register)
    Line 122 of main.php

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Let me add that of course I did run flush=1 and I did manually delete the files in silverstripe-cache

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Forum Trunk API Changes Link to this post

    Thanks Kalileo - it was an issue with the code. I have fixed it in r101697.

    The member register section is next on my refactoring / cleanup / writing tests mission!!!

    Cheers.

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Thanks Will,

    I downloaded and installed the new forum-trunk-r101697.tar.gz, and emptied the cache (silverstripe-cache), also ran /dev/build and even ?flush=1 .

    Unfortunately I still have the same error

    My SS version is SilverStripe-v2.4.0-beta1, would I need something later or trunk?

    I get the error when trying to register, or when trying to see the profile of a member / moderator. It is always the same error:

    [User Error] Uncaught Exception: Object->__call(): the method 'forumholder' does not exist on 'ForumMemberProfile'
    GET /ForumMemberProfile/register
    Line 620 in /srv/www/virtual/mydomain.com/htdocs/sapphire/core/Object.php


    and

    [User Error] Uncaught Exception: Object->__call(): the method 'forumholder' does not exist on 'ForumMemberProfile'
    GET /ForumMemberProfile/show/9
    Line 620 in /srv/www/virtual/mydomain.com/htdocs/sapphire/core/Object.php

    After that it is exactly the same dump as before. The only difference is the line about the "GET", it is either "GET /ForumMemberProfile/register" or "GET /ForumMemberProfile/show/9".

    If you want me to get trunk / svn for forum or SS just let me know and I'll test.

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Hmmm, hold it for a moment, I might have messed up something, the code in forum is still the same as forum-trunk-r101555 :o I'll report in a few minutes.

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    OK, now with the real code as in forum-trunk-r101697 but still same error.

    If I've seen it correctly, there is indeed no method ForumMemberProfile->ForumHolder() - shouldn't it be there somewhere?

    I commented the elseif block where I see that you made a change, starting line 140 of ForumMemberProfile, but I get the same error when trying to register so that part of code seems not to cause the problem.

    /*       } elseif($this->getForumHolder()->OpenIDAvailable() && ($member = DataObject::get_one("Member",
                   "\"IdentityURL\" = '". Convert::raw2sql($data['IdentityURL']) ."'"))) {
                      
                if($member) {
                   $form->addErrorMessage("Blurb",
                      _t('ForumMemberProfile.OPENIDEXISTS','Sorry, that OpenID is already registered. Please choose another or register without OpenID.'),
                      "bad");

                   // Load errors into session and post back
                   Session::set("FormInfo.Form_RegistrationForm.data", $data);
                   Director::redirectBack();
                   return;
             }
    */       } elseif($member = DataObject::get_one("Member",

    I there was another change in ForumMemberProfile then I missed it.

    Just to be sure that I'm not missing something, here are the files which I got with r101697:

    ..../htdocs/forum/code> l
    drwxr-xr-x 2 xxxx users 136 2010-03-26 07:23 formfields/
    -rw-r--r-- 1 xxxx users 1080 2010-02-14 07:04 ForumCategory.php
    -rw-r--r-- 1 xxxx users 24118 2010-03-09 05:04 ForumHolder.php
    -rw-r--r-- 1 xxxx users 17521 2010-03-26 08:38 ForumMemberProfile.php
    -rw-r--r-- 1 xxxx users 31213 2010-03-23 08:52 Forum.php
    -rw-r--r-- 1 xxxx users 11412 2010-03-23 08:52 ForumRole.php
    -rw-r--r-- 1 xxxx users 5624 2010-03-23 08:53 ForumThread.php
    drwxr-xr-x 2 xxxx users 88 2010-03-26 07:23 migration/
    -rw-r--r-- 1 xxxx users 6086 2010-03-23 08:51 Post.php
    drwxr-xr-x 2 xxxx users 80 2010-03-26 07:23 reports/

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Forum Trunk API Changes Link to this post

    Will has fixed this in trunk r102056.

    The PHP 5.3 magic did hide the issue if you use PHP 5.3, only PHP < 5.3 was affected.

    Now all the issues I reported above with registration and profile work also with PHP 5.2

  • drye
    Avatar
    Community Member
    49 Posts

    Re: Forum Trunk API Changes Link to this post

    Will thanks for your hard work on the forum. I am seeing an issue with 2.4 trunk and Forum trunk as of April 16th 2010.

    public function getForumThread() {
          return DataObject::get_by_id("ForumThread", Director::urlParam('OtherID'));
       }

    Director::urlParam('OtherID') is returning show, and not the ID. Any ideas, or suggestions?

    More info:
    This URL:
    http://localhost.com/community/commitment-managment/podcasts-and-videos/show/9

    Has a print_r on Director::urlParams()) of:
    [Controller] => ModelAsController
    [URLSegment] => community
    [Action] => commitment-managment
    [ID] => podcasts-and-videos
    [OtherID] => show

    I believe the Action should be show and OtherID should be 9, I assume this is a nested-url bug maybe?

    4790 Views
Page: 1 2 3
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.