AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] PHP Warning: Invalid argument supplied for foreach() in wpforo/wpforo.php on line 141

4 Posts
2 Users
0 Reactions
3,580 Views
Posts: 56
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@glowball)
Trusted Member
Joined: 9 years ago
[#4777]

I'm seeing the same PHP warnings in my log but I don't think there are any front end error messages:

PHP Warning:  Invalid argument supplied for foreach() in /my_home/public_html/wp-content/plugins/wpforo/wpforo.php on line 141 

This is the code and the foreach() it mentions:

public function phrases(){
if($this->general_options){
$phrases = $this->phrase->get_phrases( array( 'langid' => $this->general_options['lang'] ) );
foreach($phrases as $phrase){
$this->phrases[addslashes(strtolower($phrase['phrase_key']))] = $phrase['phrase_value'];
}
}
}

It's not urgent as there are no external symptoms, but what can I do to resolve the error? Thanks!


3 Replies
Robert
Posts: 10716
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

I think your the _wpforo_phrases table is empty. Please check it in database. If so, please navigate to Dashboard > Forums > Settings and upload this XML file (unzip before uploading).


Posts: 56
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@glowball)
Trusted Member
Joined: 9 years ago

It's not empty.  I've actually been changing phrases in the admin tool successfully, and that's working very well.  And thanks for providing that option, it's very easy to use.


Robert
Posts: 10716
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 2 months ago

Ok, check this and fix in next update.


Share: