Advertisement:

Author Topic: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php  (Read 2184 times)

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
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


Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 13,116
  • Kaizoku Jotei
    • Free SMF mods
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #1 on: February 25, 2012, 11:38:29 AM »
Attach that file here
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #2 on: February 25, 2012, 11:45:51 AM »
Thank you.... I have attached the file

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 13,116
  • Kaizoku Jotei
    • Free SMF mods
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #3 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.
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #4 on: February 25, 2012, 05:00:05 PM »
thanks a bunch, so how do i remove the entire function of it? where should i delete it from?

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 13,116
  • Kaizoku Jotei
    • Free SMF mods
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #5 on: February 25, 2012, 05:01:55 PM »
This is the whole code, just remove it:

Code: [Select]
//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);
}
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #6 on: February 26, 2012, 10:41:03 AM »
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

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 13,116
  • Kaizoku Jotei
    • Free SMF mods
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #7 on: February 26, 2012, 10:56:02 AM »
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.
Hand in glove
We can go wherever we please
And everything depends upon
How near you stand to me

And if the people stare
Then the people stare
Oh, I really don't know and I really don't care

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #8 on: February 26, 2012, 04:09:50 PM »
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?

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,584
  • Gender: Male
  • Yum!
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #9 on: February 26, 2012, 04:17:33 PM »
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...

Offline Tek007Tek007

  • Newbie
  • *
  • Posts: 8
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #10 on: February 27, 2012, 11:03:35 AM »
Everything went perfectly, Thanks so much @Suki and K@, am most grateful.

MrPhil

  • Guest
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #11 on: February 27, 2012, 01:33:36 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:
Code: [Select]
//FB Slide Like Box function - end
function ModifyWAPModSettings($return_config = false)

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,584
  • Gender: Male
  • Yum!
Re: Please Help me on how to resolve Fatal error:Sources/ManageSettings.php
« Reply #12 on: February 27, 2012, 01:41:55 PM »
Everything went perfectly, Thanks so much @Suki and K@, am most grateful.

Pleasure! :)