Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 13 years ago

#1728 closed defect (bug) (fixed)

[patch] Notices revealed with WP_DEBUG

Reported by: kristarella's profile kristarella Owned by:
Milestone: 1.5 Priority: major
Severity: Version:
Component: Activity Keywords: has-patch, needs-testing
Cc:

Description

I was testing out themes and child themes and turned on WP_DEBUG, which revealed the following notices on a fresh install of WP 2.9.1.
When logged into the admin and performing an action like activating a theme or activating/deactivating a plugin these notices are all that come up, the dashboard doesn't load.

Notice:  Undefined offset:  0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 72

Notice: Trying to get property of non-object in /Users/kristen/Sites/testing/wp-includes/query.php on line 367

Notice: Undefined offset: 0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 97

Notice: Undefined offset: 0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 104

Notice: Undefined offset: 0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 130

Notice: Use of undefined constant VHOST - assumed 'VHOST' in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 132

Notice: Undefined offset: 0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 138

Notice: Undefined offset: 1 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 141

Notice: Use of undefined constant VHOST - assumed 'VHOST' in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 151

Notice: Undefined property: stdClass::$loggedin_user in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-forums.php on line 433

Notice: Trying to get property of non-object in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-forums.php on line 433

Notice: Undefined property: stdClass::$displayed_user in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core.php on line 1005

Notice: Trying to get property of non-object in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core.php on line 1005

Notice: Undefined property: stdClass::$profile in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php on line 796

Notice: Undefined property: stdClass::$current_group in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-groups.php on line 224

Notice: Trying to get property of non-object in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-groups.php on line 224

Notice: Undefined variable: count_indicator in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-messages.php on line 115

Notice: Undefined index: action in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-signup.php on line 269

Notice: Undefined index: action in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core.php on line 1894

Notice: Undefined offset: 0 in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php on line 253

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined index: bp-message in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core.php on line 1303

Notice: Undefined index: bp-message-type in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core.php on line 1306

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 1072

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Notice: Undefined property: stdClass::$is_directory in /Users/kristen/Sites/testing/wp-content/plugins/buddypress/bp-core/bp-core-templatetags.php on line 869

Attachments (7)

errors.patch (16.6 KB) - added by AD7six 14 years ago.
Correct warnings
errors.2.patch (21.9 KB) - added by AD7six 14 years ago.
1728.001.diff (530 bytes) - added by cnorris23 14 years ago.
Make sure VHOST is defined
1728.002.diff (708 bytes) - added by cnorris23 14 years ago.
replace deprecated _c() with _x()
1728.003.diff (54.2 KB) - added by cnorris23 14 years ago.
replace deprecated attribute_escape() with esc_attr()
1728.004.diff (4.4 KB) - added by cnorris23 14 years ago.
replace deprecated clean_url() with esc_url()
1728.005.diff (891 bytes) - added by cnorris23 14 years ago.
make sure xprofile constants aren't already defined

Download all attachments as: .zip

Change History (25)

#1 @apeatling
14 years ago

  • Milestone changed from 1.2 to Future Release

#2 @cnorris23
14 years ago

  • Cc cnorris23+wordpress@… added

@AD7six
14 years ago

Correct warnings

#3 @AD7six
14 years ago

  • Component set to Activity
  • Keywords has-patch needs-testing added

Hi,

With the sole purpose of being able to see my own errors - I went through the buddy press core and corrected (or unintentionally hid) the errors I encountered - at least in the admin and superficially browsing around the public pages.

IMO this is not a minor bug. Generating an error is not free (i.e. Buddy press would perform faster if it didn't generate so many errors) and it makes it pretty difficult to contribute/write plugins if your own mistakes get drowned in the noise.

Rather than correct the error messages (as I have done) it would be better to correct the reasons they exist in the first place which in most cases comes from using uninitialized/undefined class variables.

I'm not that familiar with buddy press (or wordpress for that matter) so I hope this patch is useful. It's not complete - applying (only) my patch should not close this ticket.

Regards,

AD

@AD7six
14 years ago

#4 @cnorris23
14 years ago

  • Cc cnorris23+wordpress@… removed

#5 @DJPaul
14 years ago

  • Milestone changed from Future Release to 1.2.4

Can we try to look at this sort of thing for the 1.2.4 release?

#6 @cnorris23
14 years ago

@DJPaul
+1. I was actually going to suggest this a topic for the next dev chat.

#7 @johnjamesjacoby
14 years ago

  • Milestone changed from 1.2.4 to 1.3

This patch is now quite out of date with the current branch.

I spent a few hours today trying to get it to apply and bug test getting BP to play nicely with WP_DEBUG, but I think it's more work than we can fit into a point release.

Bumping to 1.3 unless someone wants to take a crack at getting this patch to apply to current branch.

#9 @cnorris23
14 years ago

Make sure VHOST is defined

@cnorris23
14 years ago

Make sure VHOST is defined

#10 @cnorris23
14 years ago

The function _c() was deprecated in WP 2.9. It's recommended replacement is _x().

@cnorris23
14 years ago

replace deprecated _c() with _x()

#11 @cnorris23
14 years ago

The function attribute_escape() has been deprecated since WP 2.8. It's recommended replacement is clean_url().

@cnorris23
14 years ago

replace deprecated attribute_escape() with esc_attr()

#12 @cnorris23
14 years ago

Correction (RE: Comment 11):
The recommended replacement for attribute_escape() is esc_attr() not, clean_url().

#13 @cnorris23
14 years ago

The function clean_url() is deprecated as of WP 3.0. It's recommended replacement is esc_url().

@cnorris23
14 years ago

replace deprecated clean_url() with esc_url()

#14 @cnorris23
14 years ago

Make sure the constants 'BP_XPROFILE_BASE_GROUP_NAME' and 'BP_XPROFILE_FULLNAME_FIELD_NAME' aren't already defined.

@cnorris23
14 years ago

make sure xprofile constants aren't already defined

#15 @paulhastings0
14 years ago

  • Summary changed from Notices revealed with WP_DEBUG to [patch] Notices revealed with WP_DEBUG

#16 @DJPaul
14 years ago

  • Priority changed from minor to major

I've not tried to see if this patch will still apply cleanly to trunk, but we certainly need to remove as many notices as possible in the time we have before 1.3.

#17 @boonebgorges
13 years ago

I'm closing this because I believe that the particular messages mentioned have been taken care of in DJPaul's recent sweeps. If you find more WP_DEBUG issues, please open a specific ticket.

#18 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.