cancel
Showing results for 
Search instead for 
Did you mean: 

Create a folder in PHP

pyt
Champ on-the-rise
Champ on-the-rise
Hey guys,

I wrote a script in PHP to create a folder. Actually it works pretty good, but when I want to refer to the folder, it doesn't work.

This is my code:

$name = 2013;
$nodes = $session->query($spacesStore, "PATH:\"app:company_home/st:sites/cm:foo/cm:documentLibrary/cm:bar\"");
$contentNode = $nodes[0];
$newSpace = $contentNode->createChild('cm_folder','cm_contains',$name);
$newSpace->cm_name = $name;
$newSpace->cm_description = 'Description of Space';
$newSpace->cm_title = 'test';
$session->save();


This is how I look up for my node in PHP:

$year = 2013;
$nodes = $session->query($spacesStore, "PATH:\"app:company_home/st:sites/cm:foo/cm:documentLibrary/cm:bar/".$year."\"");
$contentNode = $nodes[0];


When I look up for my new node in the node browser, the path of the node is:

/app:company_home/st:sites/cm:foo/cm:documentLibrary/cm:bar/_x0032_013


I guess to properly refer to my node my path should be:

/app:company_home/st:sites/cm:foo/cm:documentLibrary/cm:bar/cm:_x0032_013


Does anyone know how I have to change my "folder creation code" so that my path looks thr same as shown above?

Best regards
pyt
1 REPLY 1

nanny
Champ in-the-making
Champ in-the-making
Hello pyt,

I have the same problem. Do you already have a solution?

Best regards,
Nanny