From bf1247e197d4e2d3d153796adbcb102b12e80cd8 Mon Sep 17 00:00:00 2001 From: Nicola Marini Date: Wed, 13 Aug 2014 17:42:51 +0200 Subject: [PATCH] Fix issue when searching an asset in CMS backend On Windows, searching for a file return the paths with the "\" separator, and throws an error when selecting a file for editing. --- modules/cms/widgets/AssetList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cms/widgets/AssetList.php b/modules/cms/widgets/AssetList.php index 97c5c4917..e9eb20127 100644 --- a/modules/cms/widgets/AssetList.php +++ b/modules/cms/widgets/AssetList.php @@ -640,7 +640,7 @@ class AssetList extends WidgetBase if ($this->pathMatchesSearch($words, $path)) { $result[] = (object)[ 'type'=>'file', - 'path'=>$path, + 'path'=>File::normalizePath($path), 'name'=>$item->getFilename(), 'editable'=>in_array(strtolower($item->getExtension()), $editableAssetTypes) ]; @@ -664,4 +664,4 @@ class AssetList extends WidgetBase return true; } -} \ No newline at end of file +}