Skip to content

Commit b170db4

Browse files
VC-2839 add binary saving toggle update (#2036)
* VC-2839 add toggle to switch off binary saving content * VC-2839 synchronize binary checking with settings disable binary toggle
1 parent 4987835 commit b170db4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

visualcomposer/Modules/Editors/Settings/AlternativeSavingController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function buildPage()
8585
*/
8686
protected function renderToggle($value, Options $optionsHelper)
8787
{
88-
$isEnabled = (bool)$optionsHelper->get($this->optionVcvSlug, false);
88+
$isEnabled = (bool)$optionsHelper->get($this->optionVcvSlug, true);
8989

9090
return vcview(
9191
'settings/fields/toggle',

visualcomposer/Modules/Settings/Ajax/SystemStatusController.php

+6
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,14 @@ protected function addVariables($variables, Options $optionsHelper)
9494
$isBinary = true;
9595
}
9696

97+
// is user enable toggle manually we should not use binary saving anymore
9798
if ($optionsHelper->get('settings-alternative-saving-enabled') === 'itemAlternativeSavingDisabled') {
9899
$isBinary = false;
100+
} else {
101+
// if checking pass then we should disable base64 encoding for a user
102+
if ($isBinary) {
103+
$optionsHelper->set('settings-alternative-saving-enabled', false);
104+
}
99105
}
100106

101107
$variables[] = [

0 commit comments

Comments
 (0)