Commit 4c479463ea6b58baba8b6b634f29f360cbb82e0f
1 parent
c8a758a4
BBS-298
"Mac OS X Webdav as 3rd Party Client" In Progress. Root folder parent_id was changed to null. Changed the sql to use is_null instead of =0. Affects all webdav, not only Mac. Committed By: Megan Watson Reviewed By: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7412 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
2 deletions
ktwebdav/lib/KTWebDAVServer.inc.php
| ... | ... | @@ -1105,8 +1105,13 @@ class KTWebDAVServer extends HTTP_WebDAV_Server |
| 1105 | 1105 | continue; |
| 1106 | 1106 | } |
| 1107 | 1107 | // FIXME: Direct database access |
| 1108 | - $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1109 | - $aParams = array($iFolderID, $sFolderName); | |
| 1108 | + if($iFolderID == 0){ | |
| 1109 | + $sQuery = "SELECT id FROM folders WHERE parent_id is null AND name = ?"; | |
| 1110 | + $aParams = array($sFolderName); | |
| 1111 | + }else{ | |
| 1112 | + $sQuery = "SELECT id FROM folders WHERE parent_id = ? AND name = ?"; | |
| 1113 | + $aParams = array($iFolderID, $sFolderName); | |
| 1114 | + } | |
| 1110 | 1115 | $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); |
| 1111 | 1116 | if (PEAR::isError($id)) { |
| 1112 | 1117 | $this->ktwebdavLog("A DB error occurred in _folderOrDocument", 'info', true); | ... | ... |