Skip to content

Commit

Permalink
Merge pull request #2534 from nextcloud/backport/2533/stable25
Browse files Browse the repository at this point in the history
[stable25] feat: Handle complex location type
  • Loading branch information
artonge authored Jul 8, 2024
2 parents 945347b + ddf6c3f commit ae6a6eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Sabre/Album/PropFindPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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 @@ -154,6 +155,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 ae6a6eb

Please sign in to comment.