Skip to:
Content

BuddyPress.org

Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#8015 closed defect (bug) (fixed)

personal data exporter error

Reported by: Venutius Owned by: boonebgorges
Milestone: 4.1.0 Priority: normal
Severity: normal Version:
Component: Members Keywords:
Cc:

Description

I was testing the export of personal data and I got the following errors while WordPress was compiling the results:

[30-Nov-2018 10:25:56 UTC] PHP Notice: Trying to get property 'id' of non-object in wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php on line 853
[30-Nov-2018 10:25:56 UTC] PHP Notice: Undefined variable: notification_item in /wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php on line 853
[30-Nov-2018 10:25:56 UTC] PHP Notice: Undefined property: stdClass::$total_count in /wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php on line 849

Changing $notification-item to $notification clears the first two of these errors but it looks like total_count is not a valid property for the $notification array.

Change History (5)

#1 @boonebgorges
22 months ago

In 12305:

Fix variable name typo in notifications exporter.

Introduced in [12158].

Props Venutius.
See #8015.

#2 @boonebgorges
22 months ago

In 12306:

Fix variable name typo in notifications exporter.

Introduced in [12158].

Merges [12305] to the 4.0 branch.

Props Venutius.
See #8015.

#3 @boonebgorges
22 months ago

  • Component changed from Core to Members
  • Milestone changed from Awaiting Review to 4.1.0

Thank you for the report. notification_item was a copy-paste error.

total_count only exists when fetching grouped notifications, which we're not doing in this context. See https://buddypress.trac.wordpress.org/browser/tags/4.0.0/src/bp-notifications/classes/class-bp-notifications-notification.php?marks=1156#L1149

But because we're using the same 'bp_notifications_get_notifications_for_user' filter, we need to pass *something* in this spot. I'm going to change it to null.

#4 @boonebgorges
22 months ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 12307:

Don't pass non-existent total_count value to notification export filter.

total_count is available only in other contexts where this filter exists.
Instead, we pass a null value.

Props Venutius.
Fixes #8015.

#5 @boonebgorges
22 months ago

In 12308:

Don't pass non-existent total_count value to notification export filter.

total_count is available only in other contexts where this filter exists.
Instead, we pass a null value.

Merges [12307] to the 4.0 branch.

Props Venutius.
Fixes #8015.

Note: See TracTickets for help on using tickets.