Opened 14 years ago
Closed 14 years ago
#3440 closed defect (bug) (fixed)
foreach error when you delete bp_pages from db
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | minor |
Severity: | minor | Version: | 1.5 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
If you delete the bp_pages entry in wp-options from database it causes a foreach error. I know most people will not do this and you can easily fix by re association pages but a little error checking could be added.
Change History (6)
#2
@
14 years ago
And shouldn't like 95 be:
foreach( (array)$page_ids as $component_name => $page_id ) {
It is currently:
foreach( $page_ids as $component_name => $page_id ) {
#3
@
14 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 1.5
- Priority changed from normal to minor
- Severity changed from normal to minor
- Version set to 1.5
enderandrew - Yes, that's the fix.
#5
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Sadly, in applying this patch I now get a new error.
Fatal error: Cannot unset string offsets in /htdocs/wp-content/plugins/buddypress/bp-core/bp-core-functions.php on line 97
Line 97 is:
unset( $page_ids[$component_name] );
That sure looks like an array, and not a string there. So I'm at a loss. But this is why I'm not a developer.
Is $component_name a string, and thusly is that a non-numeric offset for the string index?
Are you talking about:
Warning: Invalid argument supplied for foreach() /htdocs/wp-content/plugins/buddypress/bp-core/bp-core-functions.php on line 95
Because I'm getting that all of a sudden. I had the error where pages were spamming left and right and was advised to wipe bp_pages in wp-options.