Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error

Started by cloudcity, January 12, 2020, 11:38:55 PM

Previous topic - Next topic

cloudcity

Hi! We were on 2.0.15 and trying to get up to 2.0.16. After installation, I got a message that it was successful. Logged in. Going back to Admin area to do next upgrade to 2.0.17, I get this:

QuoteAn Error Has Occurred!
syntax error, unexpected 'show_privacy_policy_warning' (T_STRING)

Confirmed that other forum admins also get the same error when they try to access the Admin section. Didn't find anything through search here for this particular error. Any ideas?

Sir Osis of Liver

Did package manager throw any errors when you installed upgrade?  Look in Admin.template.php for this -



if (!empty($context['show_privacy_policy_warning']))
echo '
if (itemID == "gdpr" && itemValueHandle.value == 1) {
alert("' . $txt['core_settings_privacy_policy_warning'] . '");
}';


Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

cloudcity

Thanks, Sir. No errors thrown. That code does not appear in my admin.template.php file. Should I add it?

(Semi-noob - I know just enough to be dangerous)

Sir Osis of Liver

Don't see how it could not be there at all.  Did you try to find 'show_privacy_policy_warning'?  Should be a syntax error in that line of code.
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

cloudcity

I must have mis-typed on my find. Apologies.

There are two references to show_privacy_policy_warning.

['core_settings_switch_on'], '\';';';

if (!empty($context['show_privacy_policy_warning']))
echo '
if (itemID == "gdpr" && itemValueHandle.value == 1) {
alert("' . $txt['core_settings_privacy_policy_warning'] . '");
}';

echo '
if (!empty($context['show_privacy_policy_warning']))
echo '
if (itemID == "gdpr" && itemValueHandle.value == 1) {
alert("' . $txt['core_settings_privacy_policy_warning'] . '");
}';

Sir Osis of Liver

Duplicate code.  Should look like this -



// Change the image, alternative text and the title.
document.getElementById("switch_" + itemID).src = \'', $settings['images_url'], '/admin/switch_\' + (itemValueHandle.value == 1 ? \'on\' : \'off\') + \'.png\';
document.getElementById("switch_" + itemID).alt = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';
document.getElementById("switch_" + itemID).title = itemValueHandle.value == 1 ? \'', $txt['core_settings_switch_off'], '\' : \'', $txt['core_settings_switch_on'], '\';';

if (!empty($context['show_privacy_policy_warning']))
echo '
if (itemID == "gdpr" && itemValueHandle.value == 1) {
alert("' . $txt['core_settings_privacy_policy_warning'] . '");
}';

echo '
// Don\'t reload.
return false;
}



Did you install the patch twice?
Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

cloudcity

That worked!

I didn't install the patch twice. Strange.

Thank you for your quick help! I appreciate it.

Advertisement: