Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Advanced Workflow - Error with Silverstripe 3

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 895 Views
  • Moccy
    Avatar
    Community Member
    2 Posts

    Advanced Workflow - Error with Silverstripe 3 Link to this post

    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

  • Marcus
    Avatar
    Administrator
    86 Posts

    Re: Advanced Workflow - Error with Silverstripe 3 Link to this post

    I'm going to be working with the module a bit later today / tomorrow, so will be able to see a bit more then, but my guess is that you're selecting users/groups when initially creating the workflow? Try creating the definition first, then select users/groups after it's been saved for the first time; this will be changed so you can't perform those actions until after it's saved.

  • Moccy
    Avatar
    Community Member
    2 Posts

    Re: Advanced Workflow - Error with Silverstripe 3 Link to this post

    Your guess is right. I now tried to create it without selecting users or groups and it just works... Thank you very much for the workaround!

    895 Views
Page: 1
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.