News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Fatal error: Function name must be a string in

Started by EGCoopey, April 03, 2011, 01:30:30 PM

Previous topic - Next topic

EGCoopey

Had another problem in ManageSetting.php. After I fixed that one, this one became apparent when I went in to Admin ~> Config ~> Modification Settings.

The fatal error: function name must be a string popped up on line 213 in ManageSettings.php.

I am using 2.0 RC5 on Krilliun Theme with a bunch of plugins. All happened when my dog got startled when I was editing the Style Sheet and chaos broke out.

Says the error is on line 213. Line 213 will be in Bold.

Quote
Line 209   // Make it easier for mods to add new areas.
   call_integration_hook('integrate_modify_modifications', array(&$subActions, &$context[$context['admin_menu_name']]['tab_data']['tabs']));

   // Call the right function for this sub-acton.
   $subActions[$_REQUEST['sa']]();
}

// This is an overall control panel enabling/disabling lots of SMF's key feature components.
function ModifyCoreFeatures($return_config = false)
{
   global $txt, $scripturl, $context, $settings, $sc, $modSettings;

   /* This is an array of all the features that can be enabled/disabled - each option can have the following:
      title      - Text title of this item (If standard string does not exist).
      desc      - Description of this feature (If standard string does not exist).
      image      - Custom image to show next to feature.
      settings   - Array of settings to change (For each name => value) on enable - reverse is done for disable. If > 1 will not change value if set.
      setting_callback- Function that returns an array of settings to save - takes one parameter which is value for this feature.
Line 227      save_callback   - Function called on save, takes state as parameter.

Plug Ins:

1.    Hide Topics from Guests    1.0    
2.    Simple Ad Rotator    1.0    
3.    PaypalDonations    2.0    
4.    nneonneo's AJAX ShoutBox    1.22    
5.    Advanced Reputation System    1.8.3    
6.    Effectively Remove SMF Logo    1.2    
7.    Ultimate Profile    0.9.1    
8.    reCAPTCHA for SMF    0.9.8

Kays

Hi, I believe that integration hook is broken.

What were the last mods you installed?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

EGCoopey

the last thing I uninstalled was Hide Topics from Guests.

Last installed one was Paypal Donations.

But, EVERYTHING worked when I installed the last plugin.

Kays

Were you able to access the settings area for each mod after installing them?

Unless I'm missing it, none of those mods seem to use integration hooks.

Can you post the code from about line 187 where the $subActions array starts down to line 210.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

EGCoopey

I had no problem accessing any menu after every mod. I checked every menu after installing each mod.

Here is line 109 to 209:

Quote
   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
      'sig' => 'ModifySignatureSettings',
      'profile' => 'ShowCustomProfiles',
      'profileedit' => 'EditCustomProfiles',
   );

   loadGeneralSettingParameters($subActions, 'basic');

   // Load up all the tabs...
   $context[$context['admin_menu_name']]['tab_data'] = array(
      'title' => $txt['modSettings_title'],
      'help' => 'featuresettings',
      'description' => sprintf($txt['modSettings_desc'], $settings['theme_id'], $context['session_id'], $context['session_var']),
      'tabs' => array(
         'basic' => array(
         ),
         'layout' => array(
         ),
         'karma' => array(
            'description' => $txt['karma_settings_desc'],
         ),
         'sig' => array(
            'description' => $txt['signature_settings_desc'],
         ),
         'profile' => array(
            'description' => $txt['custom_profile_desc'],
         ),
      ),
   );

   // Call the right function for this sub-acton.
   $subActions[$_REQUEST['sa']]();
}

// This function passes control through to the relevant security tab.
function ModifySecuritySettings()
{
   global $context, $txt, $scripturl, $modSettings, $settings;

   $context['page_title'] = $txt['admin_security_moderation'];

   $subActions = array(
      'general' => 'ModifyGeneralSecuritySettings',
      'spam' => 'ModifySpamSettings',
      'moderation' => 'ModifyModerationSettings',
   );

   loadGeneralSettingParameters($subActions, 'general');

   // Load up all the tabs...
   $context[$context['admin_menu_name']]['tab_data'] = array(
      'title' => $txt['admin_security_moderation'],
      'help' => 'securitysettings',
      'description' => $txt['security_settings_desc'],
      'tabs' => array(
         'general' => array(
         ),'paypal' => array(
         ),
         'spam' => array(
            'description' => $txt['antispam_Settings_desc'] ,
         ),
         'moderation' => array(
         ),
      ),
   );

   // Call the right function for this sub-acton.
   $subActions[$_REQUEST['sa']]();
}

// This my friend, is for all the mod authors out there. They're like builders without the ass crack - with the possible exception of... /cut short
function ModifyModSettings()
{
   global $context, $txt, $scripturl, $modSettings, $settings;

   $context['page_title'] = $txt['admin_modifications'];

   $subActions = array(
      'general' >= 'ModifyGeneralModSettings','paypal' >= 'ModifypaypalSettings',
      // Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
       'ultprofile' => 'ModifyUltProfileSettings',
   );


   loadGeneralSettingParameters($subActions, 'general');

   // Load up all the tabs...
   $context[$context['admin_menu_name']]['tab_data'] = array(
      'title' => $txt['admin_modifications'],
      'help' => 'modsettings',
      'description' => $txt['modification_settings_desc'],
      'tabs' => array(
         'general' => array(
         ),
      ),
   );

   // Make it easier for mods to add new areas.

Kays

Thanks, that is what I was looking for. But it doesn't quite match up to what you posted earlier.

The line that I was looking for went missing.


// Make it easier for mods to add new areas.
call_integration_hook('integrate_modify_modifications', array(&$subActions, &$context[$context['admin_menu_name']]['tab_data']['tabs']));


If it's still there, as a test. Comment out the second line (add // before it like the previous line). Then try to enter the modifications area and see if you still get the error.

Also, can you attach that file to a post. Click on the "Reply" button to take you to the Post page and then click on "Attachments and other options" at the bottom.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

EGCoopey



Kays

Sorry about that. However, I think I do see the problem now.

In that file look for:


$subActions = array(
'general' >= 'ModifyGeneralModSettings','paypal' >= 'ModifypaypalSettings',
// Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
    'ultprofile' => 'ModifyUltProfileSettings',
);


And change it to:


$subActions = array(
'general' => 'ModifyGeneralModSettings',
// Mod authors, once again, if you have a whole section to add do it AFTER this line, and keep a comma at the end.
'paypal' => 'ModifypaypalSettings',
    'ultprofile' => 'ModifyUltProfileSettings',
);

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

EGCoopey

Nope, that didnt work. I un-installed the paypal mod. No luck there.

Its saying this is the line that is the problem:

$subActions[$_REQUEST['sa']](); which is line 213

Advertisement: