Hi all,
I am just upgrading to Silverstripe 3. Everything worked out perfectly, but now I tried to set up the Advanced Workflow module (the current version) which is causing me some trouble. Actually, the installation including dev/build did not bring up any errors or warnings, but when I try to create a new workflow, I always get the following error (captured with FireBug):
ERROR [User Error]: Uncaught Exception: ManyManyList::add() can't be called until a foreign ID is set
IN POST /admin/workflows/WorkflowDefinition/EditForm/field/WorkflowDefinition/item/new/ItemEditForm
Line 76 in /web/XXXXX/htdocs/silverstripe2/framework/model/ManyManyList.php
Source
======
67: * @param $extraFields A map of additional columns to insert into the joinTable
68: */
69: function add($item, $extraFields = null) {
70: if(is_numeric($item)) $itemID = $item;
71: else if($item instanceof $this->dataClass) $itemID = $item->ID;
72: else throw new InvalidArgumentException("ManyManyList::add() expecting a $this->dataClass object,
or ID value", E_USER_ERROR);
73:
74: // Validate foreignID
75: if(!$this->foreignID) {
* 76: throw new Exception("ManyManyList::add() can't be called until a foreign ID is set",
E_USER_WARNING);
77: }
78:
79: // Delete old entries, to prevent duplication
80: $this->removeById($itemID);
81:
82: // Insert new entry/entries
Trace
=====
ManyManyList->add(1)
DataList.php:836
DataList->setByIDList(Array)
CheckboxSetField.php:186
CheckboxSetField->saveInto(WorkflowDefinition)
Form.php:1176
Form->saveInto(WorkflowDefinition)
GridFieldDetailForm.php:367
GridFieldDetailForm_ItemRequest->doSave(Array,Form,SS_HTTPRequest)
Form.php:348
Form->httpSubmission(SS_HTTPRequest)
RequestHandler.php:168
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
RequestHandler.php:186
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
GridFieldDetailForm.php:82
GridFieldDetailForm->handleItem(GridField,SS_HTTPRequest)
GridField.php:649
GridField->handleRequest(SS_HTTPRequest,DataModel)
RequestHandler.php:186
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
RequestHandler.php:186
RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:149
Controller->handleRequest(SS_HTTPRequest,DataModel)
LeftAndMain.php:341
LeftAndMain->handleRequest(SS_HTTPRequest,DataModel)
AdminRootController.php:88
AdminRootController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:281
Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:112
Director::direct(/admin/workflows/WorkflowDefinition/EditForm/field/WorkflowDefinition/item/new/ItemEditForm,DataModel)
main.php:126
Does anyone have a suggestion how to solve this problem? I have not come across any relevant bug ticket.
Thanks a lot in advance,
Moccy