Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Correctly synchronize if a sub folder is selected (see #5979)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Aug 16, 2013
1 parent 21ecf01 commit 9e0c03b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Contao Open Source CMS Changelog
Version 3.1.2 (2013-XX-XX)
--------------------------

### Fixed
Correctly synchronize if a sub folder is selected (see #5979).

### Fixed
Correctly handle password which are longer than 64 characters (see #6015).

Expand Down
11 changes: 9 additions & 2 deletions system/modules/core/library/Contao/Dbafs.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public static function addResource($strResource, $blnUpdateFolders=true)
}
}

$objReturn = null;

// Create the new resources
foreach ($arrPaths as $strPath)
{
Expand Down Expand Up @@ -171,6 +173,12 @@ public static function addResource($strResource, $blnUpdateFolders=true)

$arrPids[$objFolder->path] = $objModel->id;
}

// Store the model to be returned (see #5979)
if ($objModel->path == $strResource)
{
$objReturn = $objModel;
}
}

// Update the folder hashes
Expand All @@ -179,8 +187,7 @@ public static function addResource($strResource, $blnUpdateFolders=true)
static::updateFolderHashes($arrUpdate);
}

// The last model is the resource itself
return $objModel;
return $objReturn;
}


Expand Down

0 comments on commit 9e0c03b

Please sign in to comment.