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.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

[SOLVED] Urgent help needed regarding bug when saving product


Go to End


2 Posts   1506 Views

Avatar
lorlen

Community Member, 2 Posts

17 December 2010 at 8:25am

Hey guys, whenever I try to save a product in the CMS using the latest SS and eCommerce (burnbright) I get the following error

ERROR [User Error]: Uncaught Exception: Object->__call(): the method 'setbyidlist' does not exist on 'DataObjectSet'
IN POST /admin/EditForm
Line 724 in D:\www\sapphire\core\Object.php

Source
======
715:
716: default :
717: throw new Exception (
718: "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config,
true)
719: );
720: }
721: } else {
722: // Please do not change the exception code number below.
723:
* 724: throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'",
2175);
725: }
726: }
727:
728: //
-----------------------------------------------------------------------------------------------------------------
729:
730: /**

Trace
=====
<ul>Object->__call(setByIDList,Array)
line 100 of HasManyComplexTableField.php

DataObjectSet->setByIDList(Array)
line 100 of HasManyComplexTableField.php

HasManyComplexTableField->saveInto(Product)
line 997 of Form.php

Form->saveInto(Product,1)
line 684 of LeftAndMain.php

LeftAndMain->save(Array,Form,SS_HTTPRequest)
line 304 of Form.php

Form->httpSubmission(SS_HTTPRequest)
line 137 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 155 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 281 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 124 of Director.php

Director::direct(/admin/EditForm)
line 127 of main.php

Any ideas?

Avatar
lorlen

Community Member, 2 Posts

17 December 2010 at 11:55am

Okay guys if you find this thread and have the same problem, here is what it was for me

In Page.php I had added a method called ProductGroups() which would return all the product groups so that every page would have access to it for a sidebar I wanted to have

class Page extends SiteTree {

public static $db = array(
);

public static $has_one = array(
);

public function ProductGroups() {
return DataObject::get("ProductGroup","",null,null,null);
}

}

Unfortunately for me, the official method for getting the ProductGroups in the CMS admin panel has the same name, but returns a different variable type (ComponentSet rather than DataObjectSet) and that is why the problem occurred!

Hope this helps somebody