PHP notice on version 2.6.11
-
I am receiving this php notice:
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the bbpress domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later.
I am running Version 2.6.11
-
what additional bbpress related plugins are you running?
I am running a courses site with LearnPress
so just bbpress and learnpress?
Not just that. Here is the full list:
- Advanced Custom Fields Versin 6.3.12 por WP Engine
- Akismet Anti-spam: Spam Protection Versin 5.3.5 por Automattic – Anti-spam Team
- bbPress Versin 2.6.11 por The bbPress Contributors
- BuddyPress Versin 14.3.3 por The BuddyPress Community
- CoBlocks Versin 3.1.14 por GoDaddy
- H5P Versin 1.16.0 por Joubel
- LearnPress Versin 4.2.7.5.1 por ThimPress
- LearnPress – bbPress Integration Versin 4.0.5 por ThimPress
- LearnPress – BuddyPress Integration Versin 4.0.2 por ThimPress
- LearnPress – Collections Versin 4.0.1 por ThimPress
- LearnPress – Coming Soon Courses Versin 4.0.6 por ThimPress
- LearnPress – Course Review Versin 4.1.4 por ThimPress
- LearnPress – Prerequisites Courses Versin 4.0.8 por ThimPress
- Loco Translate Versin 2.7.1 por Tim Whitlock
- PublishPress Capabilities Versin 2.18.2 por PublishPress
- Safe SVG Versin 2.3.1 por 10up
- Site Kit by Google Versin 1.145.0 por Google
- WP Mail SMTP Versin 4.3.0 por WP Mail SMTP
- WP Rocket Versin 3.18 por WP Media
- WP User Manager Versin 2.9.12 por WP User Manager
Thanks
This is just a warning that WordPress 6.7 introduced.
bbpress in itself does not issue that warning, so I’d suspect that another plugin is affecting this.
so you need to test to see which other plugin or your theme is doing this.
I’d start with loco translate and LearnPress bbPress Integration as likely candidates.
If not you’ll need to work out which
Themes
As a test switch to a default theme such as twentytwenty, and see if this fixes.
Plugins
If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users
Then come back
Thank you so much for the info.
thank you for the response and the info.
I have a local dev version, but it’s not an exact copy of the production site, so I may try this tool you recommended
pretty sure that it is LearnPress bbPress Integration
We have submitted a change required to Learndash.
If you are into code the fix is in learndash-bbpress\includes\class-dependency-check.php line 119 the line needs changing from
$plugin_header = get_plugin_data( trailingslashit( str_replace( '\\', '/', WP_PLUGIN_DIR ) ) . $plugin_key );
to$plugin_header = get_plugin_data( trailingslashit( str_replace( '\\', '/', WP_PLUGIN_DIR ) ) . $plugin_key, false, false );This then prevents translations being loaded at that point (too early) and hopefully fixes the issue.
I am not using Learndash, but Learnpress, is that line on both plugins the same?
apologies, ignore that !!
Same notice here, with v2.6.13. So I patched includes/extend/buddypress/loader.php
line 42 :
esc_html__( 'Forums', 'bbpress' ),
to :function_exists('esc_html__') && did_action('init') ? esc_html__( 'Forums', 'bbpress' ) : 'Forums',and line 119 :
'search_string' => esc_html__( 'Search Forums...', 'bbpress' ),
to :'search_string' => did_action('init') ? esc_html__( 'Search Forums...', 'bbpress' ) : 'Search Forums...',and it’s gone.
I had several similar notices from different plugins, and I suspect WPML to cause this issue. I can’t deavtivate it because last time I did it was a complete mess
I don’t have much time to go further this now, but I saw this topic so I guess Bbpress is not causing it.
@dragoeco, Thanks a lot for posting this. This notice was driving me crazy. Can I ask why you say “bbpress is not causing it.” It seems like this is something that needs to be fixed in bbpress/includes/extend/buddypress/loader.php.
I checked it out with QueryMonitor and it didn’t appear that any other plugins were involved, though I’m rather out of my depth here and might be confused.
it’s not really anyone’s ‘fault’ but bbpress would need to make the change to their code, so yes bbpress is ‘causing it’.
Thanks for the clarification @robin-w. I don’t really understand anything about the WP translation scheme, or exactly when WP changed things so that these notices are shown (when I started seeing them doesn’t seem to jibe with what I can find in the WP trac). Anyway, AFAICT this isn’t in the bbpress trac (though there are similar things there). Should it be there?
Again, I’m fairly confused about this. I’m assuming that not everyone is seeing this, or there would be a lot more complaints about it. I don’t know if that’s because some special circumstances are necessary, or just because nobody has debugging turned on
Thanks for the clarification @robin-w. I dont really understand anything about the WP translation scheme, or exactly when WP changed things so that these notices are shown (when I started seeing them doesnt seem to jibe with what I can find in the WP trac). Anyway, AFAICT this isnt in the bbpress trac (though there are similar things there). Should it be there?
Again, Im fairly confused about this. Im assuming that not everyone is seeing this, or there would be a lot more complaints about it. I dont know if thats because some special circumstances are necessary, or just because nobody has debugging turned on
Not sure why that posted twice. Sorry!
yes – 99% of sites never turn debug on, so never see any warnings.
I just updated to bbPress 2.6.14 and I notice that dragoeco’s fix was not included in that (although that loader.php file was updated to fix the object creation problem for php 8.2). What’s the best way to … increase the odds of getting that done next time? I guess the person I’m asking this question is @johnjamesjacoby.
I just saw your message @mike80222
I said bbpress is not causing it. because Robin said that in this message : https://bbpress.org/forums/topic/php-notice-on-version-2-6-11/#post-243051
I have given up trying to find the source of the error tbh. I just deactivated debugging mode. It’s the best solution (for now), but it’s just annoying when you have to debug a problem and you have dozens of similar lines.
Hi @dragoeco,
I’ve been using the patch you suggested above about 5 months ago, and it’s been working fine for me. As far as I can tell, this is something that should be fixed in bbPress. But as I mentioned I’m a bit out of my depth. If somebody knows different, they will hopefully correct me.
there are lots of causes that will show this error, many plugins load the bbpress text domain.
If you are running buddypress, then you can stop a bbpress file from causing the error by the fixes above, or by using :
once activated go to
dashboard>settings>bbp style pack>bbPress bug fixes and go to
Fix bbPress domain triggered early if Buddypress also active
Thanks a lot, more than 8 months later, your solution is still working flawlessly. This error-message was driving me nuts! Seems like this plugin has a lot of other useful features too. Your solution is greatly appreciated.
- You must be logged in to reply to this topic.