Skip to content

Commit bc177c0

Browse files
authored
Merge pull request #5400 from ExpressionEngine/fix/global-variable-directory-check
Resolved #5361 where missing variable directories caused unnecessary exceptions
2 parents bdf89f2 + 3b4a700 commit bc177c0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎system/ee/ExpressionEngine/Model/Template/GlobalVariable.php‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ protected function ensureFolderExists()
174174
}
175175

176176
/**
177-
* Load all variabless available on this site, including global variabless and
177+
* Load all variables available on this site, including global variables and
178178
* any that are currently only available as files.
179179
*
180180
* This method is run from a front-end context, so we are sensitive to having as few and light queries as possible.
181181
*
182-
* @return Collection of variabless
182+
* @return \ExpressionEngine\Service\Model\Collection
183183
*/
184184
public function loadAll()
185185
{
@@ -190,6 +190,10 @@ public function loadAll()
190190

191191
foreach ($paths as $path) {
192192
try {
193+
if (! ee('Filesystem')->isDir($path)) {
194+
continue;
195+
}
196+
193197
ee('Filesystem')->getDirectoryContents($path, true, true);
194198
} catch (\Exception $e) {
195199
//silently continue

0 commit comments

Comments
 (0)