Skip to:
Content

BuddyPress.org

Opened 7 weeks ago

Closed 5 weeks ago

Last modified 10 days ago

#9170 closed enhancement (fixed)

BP REST API Messages Endpoint - "raw" property missing from subject/excerpt/message nodes

Reported by: niftythree's profile niftythree Owned by: espellcaste's profile espellcaste
Milestone: 14.0.0 Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch
Cc:

Description

Hi there,

We've noticed a problem with the "/messages" endpoint where the "raw" version of the subject/excerpt/message is missing from the data returned (only the "rendered" version is returned). See first image.

Comparatively, the "messages" node which provides each of the messages in the thread does contain the raw data. See second image.

Our app only processes the raw portion and presents it to the user, unfortunately we cannot use the rendered version as we would like to display the data (including any emojis) as natively to the device as possible.

We believe the raw data should also be included in the messages endpoint?

We've tested all of the above with the following set-up:

Thanks.

Attachments (2)

Emoji-1.png (75.8 KB) - added by niftythree 7 weeks ago.
Emoji-2.png (85.4 KB) - added by niftythree 7 weeks ago.

Download all attachments as: .zip

Change History (11)

@niftythree
7 weeks ago

@niftythree
7 weeks ago

#1 @espellcaste
7 weeks ago

@niftythree

I think our documentation can do a better job here.

But if you look at the schema of the endpoint, the raw value of those fields are only available if you use the edit context.

curl -X "OPTIONS" "https://your-site.test/wp-json/buddypress/v1/messages" \
     -u 'user:login'

The fact that the raw data is present in the messages field (without the edit context) is actually a bug you just brought to my attention, and that we should fix.

#2 @espellcaste
7 weeks ago

Pull request: https://github.com/buddypress/BP-REST/pull/510

This is the fix that makes sure the raw data respects the schema for the message and requires the edit context.

#3 @espellcaste
7 weeks ago

  • Component changed from REST API to Messages
  • Milestone changed from Awaiting Review to Up Next

#4 @espellcaste
7 weeks ago

  • Keywords has-patch added

#5 @espellcaste
7 weeks ago

  • Type changed from defect (bug) to enhancement

#6 @niftythree
7 weeks ago

Hi @espellcaste,

Thanks for the information and for looking into this so quickly. 🙂

#7 @espellcaste
5 weeks ago

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

Code merged!

#8 @espellcaste
5 weeks ago

  • Milestone changed from Up Next to 14.0.0

#9 @espellcaste
10 days ago

  • Component changed from Messages to REST API
Note: See TracTickets for help on using tickets.