AnsweredAssumed Answered

Duplicate Rule Folder

Question asked by rbergstrom on Jul 15, 2008

[Edit: Forgot to put in system stats]
We are running 2.1C on Linux against postgresql.

My session timed out while trying to create a content rule on the Company Home folder (during the wizard).  After re-authenticating, I received the following error:
Failed to create Rule due to error: There is more than one rule folder, which is invalid.

I saw an bug about mulitple clicks causing a duplicate rule folder that had been resolved, but no work around / corrective action was listed.

Using the node browser:

Child Name   Child Node   Primary   Association Type   Index
{}dictionary   workspace://SpacesStore/1f62ec8a-492f-11dd-96e3-c171a8e2e52c   true   {}contains   0
{}guest_home   workspace://SpacesStore/1fe05906-492f-11dd-96e3-c171a8e2e52c   true   {}contains   1
{}user_homes   workspace://SpacesStore/1ff4f27a-492f-11dd-96e3-c171a8e2e52c   true   {}contains   2
{}ruleFolder   workspace://SpacesStore/e9a7d571-4cf2-11dd-8e65-6bcdf4399333   true   {}contains   3
{}Business Development   workspace://SpacesStore/bc92470e-4eab-11dd-b71a-9f7ff37bf0b8   true   {}contains   4
{}Contracts   workspace://SpacesStore/8cb1b28f-4eac-11dd-b71a-9f7ff37bf0b8   true   {}contains   5
{}Client Account Management   workspace://SpacesStore/acfe4846-4eac-11dd-b71a-9f7ff37bf0b8   true   {}contains   6
{}Client Projects   workspace://SpacesStore/c35790e5-4eac-11dd-b71a-9f7ff37bf0b8   true   {}contains   7
{}Solution Management   workspace://SpacesStore/e74346a8-4eac-11dd-b71a-9f7ff37bf0b8   true   {}contains   8
{}Operations   workspace://SpacesStore/f606dffd-4eac-11dd-b71a-9f7ff37bf0b8   true   {}contains   9

Update:  The offending code in

   private NodeRef getSavedRuleFolderRef(NodeRef nodeRef)
        NodeRef result = null;
      List<ChildAssociationRef> assocs = this.runtimeNodeService.getChildAssocs(
      if (assocs.size() > 1)
         throw new ActionServiceException("There is more than one rule folder, which is invalid.");
        else if (assocs.size() == 1)
            result = assocs.get(0).getChildRef();
      return result;

Doing the database query myself against alf_child_assoc still yields only one rule folder.  Though, I'd note that the version field for the rule folder is "1" where the other child assoc are "2".

select version, type_qname, qname  from alf_child_assoc where parent_node_id = 34;
version |                     type_qname                      |                                qname                                
       2 | {}contains | {}Public
       2 | {}contains | {}Operations
       2 | {}contains | {}Solution Management
       2 | {}contains | {}Client Projects
       2 | {}contains | {}Client Account Management
       2 | {}contains | {}Contracts
       2 | {}contains | {}Business Development
       1 | {}contains | {}ruleFolder
       2 | {}contains | {}user_homes
       2 | {}contains | {}guest_home
       2 | {}contains | {}dictionary

Any insight as to why the call is returning multiple rule folders?

// Robert