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.

All other Modules /

Discuss all other Modules here.

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

CMSWorkflow and SS 2.3.2


Go to End


14 Posts   2968 Views

Avatar
Mo

Community Member, 541 Posts

20 June 2009 at 3:59am

Hi All,

I am having an issue with CMS workflow and the latest release of SS.

I have just upgraded SS to 2.3.2, and have the latest version of cmsWorkflow from the trunk. I am getting the error:

[User Error] DataObject::getComponents(): Unknown 1-to-many component 'WorkflowRequests' on class 'HomePage'

Looks like the issue is in the method:

public function ClosedWorkflowRequests($filter = "", $sort = "", $join = "", $limit = "") {
		$this->componentCache = array();
		
		if($filter) $filter .= ' AND ';
		$filter .= "Status IN ('Approved','Denied')";
		return $this->owner->getComponents(
			'WorkflowRequests',
			$filter,
			$sort,
			$join,
			$limit
		);
	}

in SiteTreeCMSWorkflow.php

Anyone got any Ideas what might be causing this? A partial trace is as follows, any help would be appreciated (I know this isn't meant to be stable until 2.4, but if anyone could point out a workaround, that would be great):

DataObject::getComponents(): Unknown 1-to-many component 'WorkflowRequests' on class 'HomePage'
Line 1086 of DataObject.php

DataObject->getComponents(WorkflowRequests,Status IN ('Approved','Denied'),,,)
Line 259 of SiteTreeCMSWorkflow.php

SiteTreeCMSWorkflow->ClosedWorkflowRequests()
Line 139 of SiteTreeCMSWorkflow.php

SiteTreeCMSWorkflow->getWorkflowCMSFields()
Line 123 of SiteTreeCMSWorkflow.php

SiteTreeCMSWorkflow->updateCMSFields(FieldSet,,,,,,)
Line 741 of Object.php

Object->extend(updateCMSFields,FieldSet)
Line 1328 of SiteTree.php

SiteTree->getCMSFields()
Line 14 of Page.php

Page->getCMSFields()
Line 55 of HomePage.php

HomePage->getCMSFields(CMSMain)
Line 390 of CMSMain.php

CMSMain->getEditForm(1)
Line 925 of LeftAndMain.php

LeftAndMain->EditForm()

call_user_func_array(Array,Array)
Line 550 of ViewableData.php

Avatar
Mo

Community Member, 541 Posts

20 June 2009 at 4:11am

Right, I have found a fix of sorts, adding:

public static $has_many = array(
	'WorkflowRequests' => 'WorkflowRequest'	
);

To my page class gives it the association the page requires, but I am guessing this is meant to be handled by the plugin?

Mo

Avatar
Sam

Administrator, 690 Posts

21 June 2009 at 11:18pm

Yes, the SiteTreeSubsites.php file is supposed to add that relation. Did you try doing a ?flush=1 after you installed the plugin?

Avatar
Mo

Community Member, 541 Posts

22 June 2009 at 8:11pm

Edited: 22/06/2009 8:12pm

I did do a flush, it didn't make any difference.

Mo

Avatar
Mo

Community Member, 541 Posts

22 June 2009 at 8:32pm

Ok, here is something odd, the front end is fine, its only the admin area that gives me this error.

Very odd!

Avatar
Sam

Administrator, 690 Posts

23 June 2009 at 7:49pm

Okay, damn it, I thin this is a bug in the 2.3.2 release.

I've added a ticket here: http://open.silverstripe.com/ticket/4285

Avatar
Mo

Community Member, 541 Posts

23 June 2009 at 8:46pm

Ah, doh! Well glad I could be of some help.

Do you think 2.3.2 will be updated with this bugfix, or will we have to workaround until 2.3.3?

Cheers for your help so far,

Mo

Avatar
Sam

Administrator, 690 Posts

23 June 2009 at 9:21pm

Well, we never change 2.3.2, so if a fix is required then it will definitely be in 2.3.3. The real question is "if it's a bug how long before we release 2.3.3". And that I can't answer right now... ;-)

Go to Top