@@ -55,8 +55,8 @@ function editAction()
55
55
{
56
56
$ name = $ this ->_getParam ('name ' );
57
57
58
- // Check ifa folder with the same name already exists for the same parent
59
- if ($ this ->Folder ->getFolderExists ($ name , $ folder ->getParent ()))
58
+ // Check if folder with the same name already exists for the same parent
59
+ if ($ folder -> getName () != $ name && $ this ->Folder ->getFolderExists ($ name , $ folder ->getParent ()))
60
60
{
61
61
throw new Zend_Exception ('This name is already used ' );
62
62
}
@@ -239,6 +239,9 @@ public function createfolderAction()
239
239
$ folder_id = $ this ->_getParam ('folderId ' );
240
240
$ folder = $ this ->Folder ->load ($ folder_id );
241
241
$ header = "" ;
242
+ $ form = $ this ->Form ->Folder ->createEditForm ();
243
+ $ formArray = $ this ->getFormAsArray ($ form );
244
+ $ this ->view ->form = $ formArray ;
242
245
if (!isset ($ folder_id ))
243
246
{
244
247
throw new Zend_Exception ("Please set the folderId. " );
@@ -265,6 +268,12 @@ public function createfolderAction()
265
268
}
266
269
else
267
270
{
271
+ // Check if folder with the same name already exists for the same parent
272
+ if ($ this ->Folder ->getFolderExists ($ name , $ folder ))
273
+ {
274
+ echo JsonComponent::encode (array (false , $ this ->t ('This name is already used ' )));
275
+ return ;
276
+ }
268
277
$ new_folder = $ this ->Folder ->createFolder ($ name , '' , $ folder );
269
278
$ policyGroup = $ folder ->getFolderpolicygroup ();
270
279
$ policyUser = $ folder ->getFolderpolicyuser ();
0 commit comments