Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#9170 closed enhancement (fixed)

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

Reported by: niftythree Owned by: espellcaste
Priority: normal Milestone: 14.0.0
Component: REST API Version:
Severity: normal 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 2 years ago.
Emoji-2.png (85.4 KB ) - added by niftythree 2 years ago.

Download all attachments as: .zip

Change History (11)

@niftythree
2 years ago

@niftythree
2 years ago

#1 @espellcaste
2 years 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
2 years 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
2 years ago

  • Component REST APIMessages
  • Milestone Awaiting ReviewUp Next

#4 @espellcaste
2 years ago

  • Keywords has-patch added

#5 @espellcaste
2 years ago

  • Type defect (bug)enhancement

#6 @niftythree
2 years ago

Hi @espellcaste,

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

#7 @espellcaste
2 years ago

  • Resolutionfixed
  • Status newclosed

Code merged!

#8 @espellcaste
2 years ago

  • Milestone Up Next14.0.0

#9 @espellcaste
2 years ago

  • Component MessagesREST API
Note: See TracTickets for help on using tickets.