mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fix add combinedFiles to clear logic
This commit is contained in:
parent
2a0805dda7
commit
e4b506cbe7
@ -704,25 +704,24 @@ class Requirements_Backend
|
||||
*/
|
||||
public function clear($fileOrID = null)
|
||||
{
|
||||
$types = [
|
||||
'javascript',
|
||||
'css',
|
||||
'customScript',
|
||||
'customCSS',
|
||||
'customHeadTags',
|
||||
'combinedFiles',
|
||||
];
|
||||
foreach ($types as $type) {
|
||||
if ($fileOrID) {
|
||||
foreach (array('javascript', 'css', 'customScript', 'customCSS', 'customHeadTags') as $type) {
|
||||
if (isset($this->{$type}[$fileOrID])) {
|
||||
$this->disabled[$type][$fileOrID] = $this->{$type}[$fileOrID];
|
||||
unset($this->{$type}[$fileOrID]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->disabled['javascript'] = $this->javascript;
|
||||
$this->disabled['css'] = $this->css;
|
||||
$this->disabled['customScript'] = $this->customScript;
|
||||
$this->disabled['customCSS'] = $this->customCSS;
|
||||
$this->disabled['customHeadTags'] = $this->customHeadTags;
|
||||
|
||||
$this->javascript = array();
|
||||
$this->css = array();
|
||||
$this->customScript = array();
|
||||
$this->customCSS = array();
|
||||
$this->customHeadTags = array();
|
||||
$this->disabled[$type] = $this->{$type};
|
||||
$this->{$type} = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -731,11 +730,17 @@ class Requirements_Backend
|
||||
*/
|
||||
public function restore()
|
||||
{
|
||||
$this->javascript = $this->disabled['javascript'];
|
||||
$this->css = $this->disabled['css'];
|
||||
$this->customScript = $this->disabled['customScript'];
|
||||
$this->customCSS = $this->disabled['customCSS'];
|
||||
$this->customHeadTags = $this->disabled['customHeadTags'];
|
||||
$types = [
|
||||
'javascript',
|
||||
'css',
|
||||
'customScript',
|
||||
'customCSS',
|
||||
'customHeadTags',
|
||||
'combinedFiles',
|
||||
];
|
||||
foreach ($types as $type) {
|
||||
$this->{$type} = $this->disabled[$type];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user