Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#7689 closed defect (bug) (fixed)

Non-standard 'template' loading broken in Nouveau.

Reported by: boonebgorges's profile boonebgorges Owned by: djpaul's profile DJPaul
Milestone: 3.0 Priority: normal
Severity: major Version:
Component: Templates Keywords: has-patch needs-testing
Cc:

Description

The changes in [11821] broke the loading of some AJAX templates in Nouveau. Specifically, the backward compatibility in [11821] was focused only on the 'group_members' special case from bp-legacy. But Nouveau was using the 'template' parameter in a couple of additional places: group requests, friend lists, user notifications. As a result, AJAX loading no longer works for these items (it generates a fatal error due to an attempt to load_template( '' )).

I'll follow up in a moment with a proposed fix.

Attachments (1)

7689.diff (4.7 KB) - added by boonebgorges 7 years ago.

Download all attachments as: .zip

Change History (7)

@boonebgorges
7 years ago

#1 @boonebgorges
7 years ago

  • Keywords has-patch needs-testing added

7689.diff attempts to fix this by introducing a bit more standardization to the way that custom templates are requested via AJAX. Before [11821], you would pass a template *path*. I've changed it so that you now pass (optionally) a template *label*, which could be group_members, group_requests, member_notifications, etc. When the AJAX handler sees this template, it assumes that this is a special case and loads the correct template. If template is absent, it loads $object/$object-loop, as before.

I think that this change makes the process a little bit easier to reason about than introducing more $object magic in the AJAX handler. Can I get a second set of eyes (and a bit of testing)?

#2 @DJPaul
7 years ago

I did think that might break things! I put it in for consistency during 2.9.3. Thanks for working on it.

I think the changes are much more readable, and next week, I should be able to test it for you.

#3 @hnla
7 years ago

@boonebgorges Thanks for spotting, I too will look at the breakage and run patch.

#4 @DJPaul
7 years ago

  • Owner set to DJPaul
  • Status changed from new to assigned

I'll commit this next week unless someone gets to it before me.

#5 @DJPaul
7 years ago

Tested on a handful of screens mentioned - group requests, notifications - seems to work.

#6 @djpaul
7 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 11876:

Nouveau: fix AJAX template loading.

r11821 broke the loading of some AJAX templates in Nouveau. Specifically, the backward compatibility in it was focused only on the group_members special case from bp-legacy, but Nouveau uses the template parameter in more places.

Fixes #7689

Props boonebgorges

Note: See TracTickets for help on using tickets.