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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Forum Module /

Discuss the Forum Module.

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

Forum Trunk API Changes


Go to End


19 Posts   7908 Views

Avatar
Kalileo

Community Member, 127 Posts

26 March 2010 at 4:51am

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

Avatar
Kalileo

Community Member, 127 Posts

26 March 2010 at 4:53am

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

Avatar
Willr

Forum Moderator, 5523 Posts

26 March 2010 at 8:59am

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.

Avatar
Kalileo

Community Member, 127 Posts

26 March 2010 at 2:01pm

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.

Avatar
Kalileo

Community Member, 127 Posts

26 March 2010 at 2:22pm

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.

Avatar
Kalileo

Community Member, 127 Posts

26 March 2010 at 2:50pm

Edited: 26/03/2010 3:48pm

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/

Avatar
Kalileo

Community Member, 127 Posts

1 April 2010 at 4:56pm

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 :)

Avatar
drye

Community Member, 49 Posts

21 April 2010 at 1:58am

Edited: 21/04/2010 2:05am

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?