News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

The callable ! could not be called. also Undefined index: label v2.1.4

Started by W2NAP, June 13, 2023, 05:57:19 PM

Previous topic - Next topic

W2NAP

Note if it helps I do have the board url changed to forums.php (smf index.php is renamed to forums.php with the edit pointing to it in /sources/query_string.php and has worked with no issue, not sure if that is what is causing this or if its a bug or something didn't upgrade correctly causing it.

The callable ! could not be called.
Noticed this after the 213 to 214 upgrade. triggers on every pageview.

also get Undefined index: label also showed up after the 214 upgrade
in Themes/default/GenericMenu.template.php (Line 282)

backtrace on the
The callable ! could not be called.
URL of page causing the error
https://www.w2nap.com/forums.php?action=profile;area=alerts_popup;counter=0;u=1
Backtrace information

    #0: call_helper()
    Called from /home/xxxx/www/Sources/Subs.php on line 4149
    #1: obExit()
    Called from /home/xxxxx/www/forums.php on line 187

backtrace on the index
Type of error
Undefined_vars
Error message
8: Undefined index: label
File
/home/xxxx/www/Themes/default/GenericMenu.template.php
Line
282
URL of page causing the error
https://www.w2nap.com/forums.php?action=profile;area=alerts_popup;counter=0;u=1
Backtrace information

    #0: smf_error_handler()
    Called from /home/xxxx/www/Themes/default/GenericMenu.template.php on line 282
    #1: template_generic_menu_tabs()
    Called from /home/xxxx/www/Themes/default/GenericMenu.template.php on line 58
    #2: template_generic_menu_dropdown_above()
    Called from /home/xxxx/www/Sources/Load.php on line 2778
    #3: loadSubTemplate()
    Called from /home/xxxx/www/Sources/Subs.php on line 4550
    #4: template_header()
    Called from /home/xxxx/www/Sources/Subs.php on line 4157
    #5: obExit()
    Called from /home/xxxx/www/forums.php on line 187



Sir Osis of Liver

It's a really bad idea to rename root index.php.  Why on earth would you do that?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

renaming index.php will break alot of things.   do not do that.


For once, Sir Osis and I are on the same page
Quote from: Sir Osis of Liver on June 13, 2023, 06:45:14 PMIt's a really bad idea to rename root index.php.  Why on earth would you do that?


Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

W2NAP

Quote from: Sir Osis of Liver on June 13, 2023, 06:45:14 PMIt's a really bad idea to rename root index.php.  Why on earth would you do that?


well for one, i don't have just a forum i have many other pages. and I do not like the "portal" systems that are out. also its been done for years as others have done it https://www.simplemachines.org/community/index.php?topic=58439.0
as for mine goes, its worked just fine for quite awhile now.

Sir Osis of Liver

If you revert to 2.1.3 does problem go away?  Have you cleared forum cache?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sesquipedalian

If you felt the need to rename SMF's index.php to forums.php, I suspect that is because you have files from multiple software packages in the same directory. If so, that is a terrible idea, and if you haven't run into issues before now, that is only because you have been very lucky so far. Rather than mixing different software packages together in the same directory, you should learn to use Apache's .htaccess files to rewrite and redirect URL requests in order to control what files are fetched for any given URL request. That way you can have the URLs look to the end user like everything is in one place, but actually keep the different software packages safely separated from one another.

Regarding the is_callable error, it seems that you somehow have a single exclamation mark appearing in your output_buffer array. That makes very little sense, and wouldn't happen in an unmodified SMF instance. So I suspect that either (a) you have installed a modification that is messing up badly, or (b) you do indeed have multiple software packages living in the same directory as described above, and you luck has run out as those software packages have begun stepping on one another's toes.

If the problem is a mod, then your next step will be to provide a list of all the mods that you have installed. Once you do that, the support team will be better able to help you figure out which one might be causing the issue.

If the problem is that you have multiple software packages installed in the same directory and they are interfering with each other, you are going to need to untangle that mess.

In either case, resolving your problem is likely to be a multi-step process.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shawnb61

Note that the index label issue is a known issue, with a fix coming in 2.1.5:
https://github.com/SimpleMachines/SMF/issues/7559
https://github.com/SimpleMachines/SMF/pull/7733

It's harmless & ignorable for now.


At first glance, the callable issue seems to indicate a problem with your hooks. 

I suggest reviewing your hooks in the admin console, under Admin | Maintenance | Forum Maintenance | Integration Hooks.

Note there is a known bug with repair_settings.php, where, if you choose "remove all hooks", it leaves weird blank entries with a '!' around...  It sure feels like something like that happened here.
https://github.com/SimpleMachines/tools/issues/64

If you have such weird blank entries, you will need to clear them out somehow.  I'd first try deleting them in the admin console.


Regarding rename index.php to something else, I agree with the others.  To do this properly would require changing references to 'index.php' in literally 200+ places in SMF.  Then you would need to analyze your mods, too.  You might get away with a redirect, but it sure feels like you're asking for trouble. 
A question worth asking is born in experience & driven by necessity. - Fripp

Sesquipedalian

Quote from: shawnb61 on June 14, 2023, 12:45:45 PMNote there is a known bug with repair_settings.php, where, if you choose "remove all hooks", it leaves weird blank entries with a '!' around...  It sure feels like something like that happened here.
https://github.com/SimpleMachines/tools/issues/64 

I was not aware of that. That does sound like a rational explanation for this error.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shawnb61

Prior to 2.1.4, you might get similar funky results by disabling a bunch of hooks, then deinstalling and/or reinstalling the corresponding mods...  Things were left in a weird state.  All of that has been cleaned up in 2.1.4.  Also, in 2.1.4, you are now able to clean up broken hooks within the admin console.
A question worth asking is born in experience & driven by necessity. - Fripp

live627

Quote from: shawnb61 on June 14, 2023, 12:45:45 PMRegarding rename index.php to something else, I agree with the others.  To do this properly would require changing references to 'index.php' in literally 200+ places in SMF.  Then you would need to analyze your mods, too.  You might get away with a redirect, but it sure feels like you're asking for trouble. 
I believe this is a red herring. All links in SMF are built using $scripturl

EDIT: Just did a recursive grep; the only code references to index.php appear to be
  • File cache key salting
  • Directory redirects

W2NAP

ah ha! the ! error was indeed an odd hook entry, once removed all is well, must have happened when I changed domain some months ago and ran the repair setting, may have clicked the disable hooks at some point cause i did have to reinstall the few mods I use.

Quote from: live627 on June 14, 2023, 06:57:46 PM
Quote from: shawnb61 on June 14, 2023, 12:45:45 PMRegarding rename index.php to something else, I agree with the others.  To do this properly would require changing references to 'index.php' in literally 200+ places in SMF.  Then you would need to analyze your mods, too.  You might get away with a redirect, but it sure feels like you're asking for trouble. 
I believe this is a red herring. All links in SMF are built using $scripturl

EDIT: Just did a recursive grep; the only code references to index.php appear to be
  • File cache key salting
  • Directory redirects

this is how I changed smf forum url from index.php to forums.php via $scripturl and have not seen an issue from it. (all forum urls/themes/mods work as they should) Some may think a full integration is better but last thing I want is have something go wrong with the forum and end up with an entire site down, with renaming smf/index to forums.php if the forum somehow goes down in theory its just the forum and the rest of the pages are unaffected as I can put the forum in maint mode and people still have access to rest of the site pages.

Sesquipedalian

Quote from: W2NAP on June 17, 2023, 09:42:58 AMthis is how I changed smf forum url from index.php to forums.php via $scripturl and have not seen an issue from it. (all forum urls/themes/mods work as they should) Some may think a full integration is better but last thing I want is have something go wrong with the forum and end up with an entire site down, with renaming smf/index to forums.php if the forum somehow goes down in theory its just the forum and the rest of the pages are unaffected as I can put the forum in maint mode and people still have access to rest of the site pages.

Do you have files from other software packages in the same directory as SMF? If so, that is dangerous. You should always keep each software package (e.g. SMF, Wordpress, Drupal, etc.) in its own directory.

Then you just use .htaccess files to tell the web server where to look for specific files.

For example, if you move all of your SMF files out of your site's root directory into a ./forum subdirectory, then you can use an .htaccess file to tell the web server that when someone asks to see http://example.com/forums.php, it should actually show them the file at ./forum/index.php instead of ./forums.php.

With this approach, you can safely keep your software packages separated on the file system while still presenting them as integrated to your visitors.

Mozilla offers a nice orientation to .htaccess files. You will probably be the most interested in the sections on redirects and on mod_rewrite.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

W2NAP

Quote from: Sesquipedalian on June 17, 2023, 06:55:16 PM
Quote from: W2NAP on June 17, 2023, 09:42:58 AMthis is how I changed smf forum url from index.php to forums.php via $scripturl and have not seen an issue from it. (all forum urls/themes/mods work as they should) Some may think a full integration is better but last thing I want is have something go wrong with the forum and end up with an entire site down, with renaming smf/index to forums.php if the forum somehow goes down in theory its just the forum and the rest of the pages are unaffected as I can put the forum in maint mode and people still have access to rest of the site pages.

Do you have files from other software packages in the same directory as SMF? If so, that is dangerous. You should always keep each software package (e.g. SMF, Wordpress, Drupal, etc.) in its own directory.

Then you just use .htaccess files to tell the web server where to look for specific files.

For example, if you move all of your SMF files out of your site's root directory into a ./forum subdirectory, then you can use an .htaccess file to tell the web server that when someone asks to see http://example.com/forums.php, it should actually show them the file at ./forum/index.php instead of ./forums.php.

With this approach, you can safely keep your software packages separated on the file system while still presenting them as integrated to your visitors.

Mozilla offers a nice orientation to .htaccess files. You will probably be the most interested in the sections on redirects and on mod_rewrite.

sorry for late reply, not been feeling well.

I don't actually use a CMS for the main site files, they are simple html however I do have stuff sectioned off like header, left card, right card, footer and just pull them into the main x.php with require_once call that way I can just edit say my header once and it applies to all files instead of having to edit a ton of files. I do use a few smf/ssi calls in the files

I did move the smf stuff over to forums/ couple days ago.

Advertisement: