cancel
Showing results for 
Search instead for 
Did you mean: 

BUG in createNode() for custom types?

mabayona
Champ on-the-rise
Champ on-the-rise
I´ve found out what seems to be a bug the createNode() JS function (in 2.9 at least). If you define custom types (both for cm:content and cm:folder subtypes) e.g.

   <type name="myModel:myType">
      <title>My custom Type</title>
      <parent>cm:folder</parent>
      <properties>
                          …
      </properties>
   </type>

when calling the function createNode(). E.g.

          var props = new Array();
          props["cm:name"] =  "a name";
      props["cm:description"] =  "a description";
      var my_subspace = my_space.createNode(null, "myModel:myType", props);


my_subspace is created, but is somehow not complete (e.g.{http://www.alfresco.org/model/content/1.0}source is not filled) and this has some subtle problems. The missing fields can be seen using the  "Node Browser" in the Administration Console.

Is this really a bug?
am I missing something?
it ois already known/reported?
4 REPLIES 4

mabayona
Champ on-the-rise
Champ on-the-rise
After some research on open and closed issues, I´ve found out that AR-1066 adderesses this bug and reports it as solved.

I think it is not solved (at least not in 2.9), since when creating a node using the createNode() JS function for custom types (both derived from cm:content and cm:folder) the created nodes are NOT COMPLETE since not all the default properties are created (e.g. source) and some others. This no t only the mandatory properties of the custom types, but also some standard properties as well.

For instance, when creating a file for a custom type, the created file is not complete and has the following problems:

- When clicking in the (i) ball in the document browser (to see doc details) the following error is returned: "500 Failed to execute method: NodeInfoBean.sendNodeInfo. Exception in Transaction."

- When navigating to the node (using admins Node Browser in admin console) the node is not complete and e.g. node name is replaced by a node-id like string.

I think that AR-1066 should be reopened.

mabayona
Champ on-the-rise
Champ on-the-rise
After further research in JIRA, it seems that this bug has to do as well with:

http://issues.alfresco.com/browse/ETWOTWO-327

which is open and recent. But instead of for the JS addNode() function, it has also to do with the JS createNode() as well.

Do we need a new entry in JIRA or can we add it to ETWOTWO-327?

riogrande
Champ in-the-making
Champ in-the-making
I have the same problem with 3.0 stable.
My custom property are correctly shown, but the standards are missing in the detail sheet (like title or description) Smiley Indifferent

mrogers
Star Contributor
Star Contributor
http://issues.alfresco.com/browse/ETWOTWO-327 is currently minor priority with no votes.  
Which is perhaps why its remained unresolved for so long.

Certainly add comments to the issues that concern you (thats a far more effective way of getting fixes than these forums)
and consider voting for it or increasing its priority.   And it certainly helps if there is a contributed fix.