Please Help me on how to resolve Fatal error:Sources/ManageSettings.php

Started by Tek007Tek007, February 25, 2012, 11:36:48 AM

Previous topic - Next topic

Tek007Tek007

My forum is working fine, but I just noticed any time when i click on my configuration in my admin panel in my SMF 2.0.2, would notice fatal error
Fatal error: Call to undefined function preparedbsettingcontext() in /home/t3k007/public_html/Sources/ManageSettings.php on line 2267
So please how can i resolve this? thank you


Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.


Suki

The problem is that someone comment out this line:

//FB Slide Like Box function - endfunction ModifyWAPModSettings($return_config = false)


althought, it is valid, it can cause issues, if you do not want that function just comment out the entire function or uncomment that line.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Tek007Tek007

thanks a bunch, so how do i remove the entire function of it? where should i delete it from?

Suki

This is the whole code, just remove it:


//FB Slide Like Box function - endfunction ModifyWAPModSettings($return_config = false)
{
global $txt, $scripturl, $context, $settings, $sc, $modSettings;

$config_vars = array(
array('check', 'wap_shoutbox_enable'),
array('check', 'wap_toggle'),
array('check', 'wap_attach'),
array('check', 'wap_stats'),
array('check', 'wap_iphone'),
array('select', 'wap_width', array(
'100%' => $txt['100%'],
'280px' => $txt['280px'],
'320px' => $txt['320px'])),
array('select', 'wap_theme', array(
'default' => $txt['wap_default'],
'gray' => $txt['wap_gray'],
'red' => $txt['wap_red'],
'black' => $txt['wap_black'],
'green' => $txt['wap_green'])),
array('text', 'wap_footer'),
array('text', 'wap_sig'),
array('text', 'wap_shoutbox_url'),
array('text', 'wap_iphone_url'),
array('text', 'wap_logo_url'),
);

if ($return_config)
return $config_vars;

$context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=wapmod';
$context['settings_title'] = $txt['wapmods'];

// No removing this line you, dirty unwashed mod authors. :p
if (empty($config_vars))
{
$context['settings_save_dont_show'] = true;
$context['settings_message'] = '<div style="text-align: center">' . $txt['modification_no_misc_settings'] . '</div>';

return prepareDBSettingContext($config_vars);
}

// Saving?
if (isset($_GET['save']))
{
checkSession();

$save_vars = $config_vars;

saveDBSettings($save_vars);

redirectexit('action=admin;area=modsettings;sa=wapmod');
}

prepareDBSettingContext($config_vars);
}
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Tek007Tek007

Thanks it worked but led to another problems, i got this mod called wapmod[it helps to modify my wap2 look and feel] before i got this problem, when i click on miscellanous >> wap settings it brings out an error. and when i try to uninstall any mod I have it will say "Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF"

So I was thinking if there is anything I can do to uninstall comletely all my mods from my site without any left over , to make my site back to default in other to prevent feature errors.
Thanks a lot

Suki

If you want to do a rest for your forum, then grab the large update zip for your forum version, unzip it and upload it to your forum folder overwriting the old files, that will clean up your forum from mods by replacing the old files with new ones and you will not lose any data since you won't touch the database stuff.


Do a back up before doing anything.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Tek007Tek007

Okay thanks, I just downloaded the smf_2-0-2_upgrade.zip Large upgrade which is 2.6mb
So am i to upload this file to my forum folder and extract it there to make it easier? or unzip it on my PC and upload the files one after the other and over write the existing one? and i saw
upgrade_1-0.sql
upgrade_1-1.sql
upgrade_2-0_mysql.sql
upgrade_2-0_postgresql.sql
upgrade_2-0_sqlite.sql
Am i to upload the above files to my forum folder as well, wont it affect my forum informations? e.g posts, messages,members e.t.c
Please one more question, is there any file i need to delete after upgrade for security reasons?

kat

As Suki's offline, I'll have a go at this. :)

No, you don't need those files.

You don't need upgrade.php, either, as you're already using the latest version.

No need to actually upgrade, either, obviously. Just overwrite everything and your forum will be in it's virgin state, pretty-well. All your mods will still be in "Packages". You'll need to reapply those that you want.

One thing, though. If you've overwritten your smilies, with custom files, you won't want to overwrite them, or you'll need to do those, again.

By the way, if I was in your position, I'd back everything up, first, just in case...

Tek007Tek007

Everything went perfectly, Thanks so much @Suki and K@, am most grateful.

MrPhil

Quote from: Suki on February 25, 2012, 04:44:05 PM
The problem is that someone comment out this line:

//FB Slide Like Box function - endfunction ModifyWAPModSettings($return_config = false)

althought, it is valid, it can cause issues, if you do not want that function just comment out the entire function or uncomment that line.
To clarify, the actual problem is that someone ran two lines together (or inserted the comment without a proper end-of-line), resulting in the function header going missing and all sorts of problems down the line:
//FB Slide Like Box function - end
function ModifyWAPModSettings($return_config = false)



Advertisement: