mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: fix for ticket 3384. Instead of messing round with added requirements back if you cannot merge them just return
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70587 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e855e4d126
commit
d0da8b8796
@ -778,6 +778,7 @@ class Requirements_Backend {
|
||||
*
|
||||
*/
|
||||
function process_combined_files() {
|
||||
|
||||
if(Director::isDev() && !SapphireTest::is_running_test()) {
|
||||
return;
|
||||
}
|
||||
@ -806,7 +807,7 @@ class Requirements_Backend {
|
||||
$newJSRequirements[$file] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($this->css as $file => $params) {
|
||||
if(isset($combinerCheck[$file])) {
|
||||
$newCSSRequirements[$combinerCheck[$file]] = true;
|
||||
@ -815,7 +816,7 @@ class Requirements_Backend {
|
||||
$newCSSRequirements[$file] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Process the combined files
|
||||
$base = Director::baseFolder() . '/';
|
||||
foreach(array_diff_key($combinedFiles,$this->blocked) as $combinedFile => $dummy) {
|
||||
@ -860,20 +861,11 @@ class Requirements_Backend {
|
||||
fclose($fh);
|
||||
unset($fh);
|
||||
}
|
||||
|
||||
|
||||
// Unsuccessful write - just include the regular JS files, rather than the combined one
|
||||
if(!$successfulWrite) {
|
||||
user_error("Requirements_Backend::process_combined_files(): Couldn't create '$base$combinedFile'", E_USER_WARNING);
|
||||
$keyedFileList = array();
|
||||
foreach($fileList as $file) $keyedFileList[$file] = true;
|
||||
$combinedPos = array_search($combinedFile, array_keys($newJSRequirements));
|
||||
if($combinedPos) {
|
||||
$newJSRequirements = array_merge(
|
||||
array_slice($newJSRequirements, 0, $combinedPos),
|
||||
$keyedFileList,
|
||||
array_slice($newJSRequirements, $combinedPos+1)
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user