Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 9 years ago

#6081 closed defect (bug) (fixed)

Slashes in Group description on Profile Administration screen

Reported by: imath's profile imath Owned by: djpaul's profile djpaul
Milestone: 2.4 Priority: normal
Severity: major Version:
Component: Extended Profile Keywords: has-patch
Cc: mahype

Description

A screenshot to describe the issue

https://cldup.com/9UnHJWSriH-2000x2000.png

The group description in Profile Field administration site.url/wp-admin/users.php?page=bp-profile-setup is not "stripslashed".

Attachments (3)

6081.patch (516 bytes) - added by imath 10 years ago.
contributor-day.patch (3.0 KB) - added by mahype 9 years ago.
6081.3.patch (3.9 KB) - added by DJPaul 9 years ago.

Download all attachments as: .zip

Change History (9)

@imath
10 years ago

#1 @DJPaul
10 years ago

  • Keywords needs-patch good-first-bug added; has-patch removed
  • Milestone changed from Awaiting Review to Future Release

I think using the bp_get_group_description filter here would be more appropriate and inline with how the group description would normally be rendered.

#2 @mahype
9 years ago

Parts patched on Contributor day at the WordCamp. Not finished yet.

@DJPaul
9 years ago

#3 @DJPaul
9 years ago

  • Keywords has-patch added; needs-patch good-first-bug removed
  • Milestone changed from Future Release to 2.4
  • Priority changed from low to normal
  • Severity changed from minor to major

Okay, this was fun. Maybe not a good-first-bug due to its complexity, but @mahype and I had fun exploring this issue at Wordcamp Europe contributor day. :)

1) Patch adds filters to parts of the xprofile wp-admin templates so we're running group description and name through the same output filters that are used in the front-end template parts (for stripslashes).

2) This change revealed another bug where we are storing slashes in the database (this is a known issue and we have somewhere a very old ticket), but in this case, after applying the fix in 1), editing a profile group name or description multiple times would show the extra slashes again in the templates (only stripping the first slash).

So the patch adds a stripslashes to profile group name and description before_save filters to fix the root issue.
Keeping the existing on-display stripslashes maintains backwards compatibility.

3) Which revealed a fun bug where, if you save a profile group without changing *any* details, it didn't work and we threw an error. It looks like someone misinterpreted the return values of WPDB's query and get_results functions. So this was corrected.

No unit tests, but it's now time for a siesta. :)

#4 @DJPaul
9 years ago

  • Cc mahype added

#5 @DJPaul
9 years ago

The third part of this issue has been separately fixed by @boonebgorges in r10002

#6 @djpaul
9 years ago

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

In 10239:

xprofile admin: fix handling of slashes in xprofile group name/desc

Add filters to parts of the xprofile wp-admin templates so we're
running group description and name through the same output filters that
are used in the front-end template parts (for stripslashes).

Also adds a stripslashes to profile group name and description
before_save filters to fix the root issue. By keeping the existing
on-display stripslashes, we maintain backwards compatibility.

Fixes #6081

Props mahype, djpaul

Note: See TracTickets for help on using tickets.