Skip to content

Commit

Permalink
Merge pull request #2535 from nextcloud/backport/2533/stable26
Browse files Browse the repository at this point in the history
[stable26] feat: Handle complex location type
  • Loading branch information
artonge authored Jul 8, 2024
2 parents e3d3f17 + 98d4975 commit af5a303
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Sabre/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Sabre\DAV\Server;
use Sabre\DAV\ServerPlugin;
use Sabre\DAV\Tree;
use Sabre\DAV\Xml\Property\Complex;

class PropFindPlugin extends ServerPlugin {
public const ORIGINAL_NAME_PROPERTYNAME = '{http://nextcloud.org/ns}original-name';
Expand Down Expand Up @@ -182,6 +183,10 @@ public function handleUpdateProperties($path, PropPatch $propPatch): void {
$node = $this->tree->getNodeForPath($path);
if ($node instanceof AlbumRoot) {
$propPatch->handle(self::LOCATION_PROPERTYNAME, function ($location) use ($node) {
if ($location instanceof Complex) {
$location = $location->getXml();
}

$this->albumMapper->setLocation($node->getAlbum()->getAlbum()->getId(), $location);
return true;
});
Expand Down

0 comments on commit af5a303

Please sign in to comment.