--- ezwebdavcontentbackend.php.bak	2011-01-21 16:28:37.000000000 +0100
+++ ezwebdavcontentbackend.php	2011-01-21 17:51:49.000000000 +0100
@@ -1591,7 +1591,15 @@
                 $suffix = '.' . $suffix;
             }
 
-            $entry["href"] = $startURL . $node->urlAlias() . $suffix;
+            // @edorfaus Fix the problem where the media tree doesn't work
+            // because the first element of the path is not recognized as the
+            // virtual media folder when using the url alias in the path.
+            $urlAlias=$node->urlAlias();
+            if (substr($urlAlias,0,6)=='media/') {
+                $urlAlias=self::virtualMediaFolderName().substr($urlAlias,5);
+            }
+
+            $entry["href"] = $startURL . $urlAlias . $suffix;
         }
 
         // Return array of attributes/properties (name, size, mime, times, etc.).
