Skip to:

Opened 9 months ago

Closed 9 months ago

#9014 closed defect (bug) (fixed)

Warning: Undefined property: stdClass::$type

Reported by: vapvarun's profile vapvarun Owned by: imath's profile imath
Milestone: 12.0.0 Priority: normal
Severity: normal Version: 10.0.0
Component: Templates Keywords: has-patch


After leaving a comment on the activity page, a warning appears on the same page.

[31-Oct-2023 06:25:07 UTC] PHP Warning Undefined property: stdClass::$type in /home/tavafowuca6221/web/ on line 902


Active Plugins: Query Monitor with Debug log enabled along with BuddyPress v11.4.0

Active Theme: Default WP Twenty Twenty-Three

Change History (5)

#1 @imath
9 months ago

  • Milestone changed from Awaiting Review to 12.0.0

Hi @vapvarun

Thanks for your report. I confirm I was able to reproduce in latest trunk. We'll fix it in 12.0.

#2 @imath
9 months ago

  • Component changed from Activity to Templates

This is specific to the BP Nouveau template pack

#3 @imath
9 months ago

  • Version changed from 11.4.0 to 10.0.0

This was introduced in 10.0, it's due to bp_nouveau_activity_data_attribute_id().

This ticket was mentioned in PR #182 on buddypress/buddypress by @imath.

9 months ago

  • Keywords has-patch added; needs-patch removed

This function is outputting the data-bp-activity-comment-id attribute. It was created as a replacement of bp_nouveau_activity_data_attribute_id() for the activity/comment.php template to avoid messing with activity types when not set (instead a requerying for the parent activity).

Trac ticket:

#5 @imath
9 months ago

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

In 13631:

Add a function to output the bp-activity-comment-id data attribute

In BP Nouveau, instead of using the same function to output the bp-activity-comment-id or bp-activity-id data attribute according to the activity type, introduce the bp_nouveau_activity_comment_data_attribute_id() function and use it inside the activity/comment.php template.
This prevents a notice warning notice and avoid to query for the parent activity to get the right activity type.

Props vapvarun

Fixes #9014

Note: See TracTickets for help on using tickets.