svn: /web/doc-editor/trunk/php/ ExtJsController.php

From: Date: Mon, 15 Mar 2010 00:51:34 +0000
Subject: svn: /web/doc-editor/trunk/php/ ExtJsController.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-1624@lists.php.net to get a copy of this message
yannick Mon, 15 Mar 2010 00:51:34 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296227 Log: When we create a patch from a file witch is into a no-existing folder, we create it before saving the patch - spotted by Yago Changed paths: U web/doc-editor/trunk/php/ExtJsController.php Modified: web/doc-editor/trunk/php/ExtJsController.php =================================================================== --- web/doc-editor/trunk/php/ExtJsController.php 2010-03-15 00:46:40 UTC (rev 296226) +++ web/doc-editor/trunk/php/ExtJsController.php 2010-03-15 00:51:34 UTC (rev 296227) @@ -747,17 +747,24 @@ } } else { - $uniqID = RepositoryManager::getInstance()->addPendingPatch( - $file, $emailAlert - ); + // We must ensure that this folder exist localy + if( $file->folderExist() ) { - $file->save($fileContent, true, $uniqID); + $uniqID = RepositoryManager::getInstance()->addPendingPatch( + $file, $emailAlert + ); - return JsonResponseBuilder::success( - array( - 'uniqId' => $uniqID - ) - ); + $file->save($fileContent, true, $uniqID); + + return JsonResponseBuilder::success( + array( + 'uniqId' => $uniqID + ) + ); + + } else { + return JsonResponseBuilder::failure(); + } } }

« previous php.doc.web (#1624) next »