Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: cloudcity - tammikuu 12, 2020, 11:38:55 IP

Otsikko: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: cloudcity - tammikuu 12, 2020, 11:38:55 IP
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:

LainaaAn 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?
Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: Sir Osis of Liver - tammikuu 12, 2020, 11:47:02 IP
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'] . '");
}';


Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: cloudcity - tammikuu 12, 2020, 11:57:39 IP
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)
Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: Sir Osis of Liver - tammikuu 13, 2020, 12:02:58 AP
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.
Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: cloudcity - tammikuu 13, 2020, 12:08:31 AP
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'] . '");
}';
Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: Sir Osis of Liver - tammikuu 13, 2020, 12:12:58 AP
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?
Otsikko: Re: Can't access Admin section after 2.0.15 to 2.0.16 upgrade - Syntax error
Kirjoitti: cloudcity - tammikuu 13, 2020, 12:18:45 AP
That worked!

I didn't install the patch twice. Strange.

Thank you for your quick help! I appreciate it.