Skip to:
Content

BuddyPress.org

#8849 closed defect (bug) (fixed)

Sitewide Notices REST API Endpoint is not initialised

Reported by: sjregan's profile sjregan Owned by: imath's profile imath
Milestone: 12.0.0 Priority: normal
Severity: normal Version: 9.0.0
Component: REST API Keywords: has-patch
Cc:

Description

The BP_REST_Sitewide_Notices_Endpoint class is not registered within the messages component rest_api_init() method:

https://github.com/buddypress/buddypress/blob/master/src/bp-messages/classes/class-bp-messages-component.php#L441

This can be seen by enabling the Messages component and visiting the API endpoint:
/wp-json/buddypress/v1/

The "/wp-json/buddypress/v1/messages" endpoint will be present, but "/wp-json/buddypress/v1/sitewide-notices" will not.

Change History (4)

This ticket was mentioned in PR #72 on buddypress/buddypress by sjregan.


17 months ago
#1

  • Keywords has-patch added

Adds 'BP_REST_Sitewide_Notices_Endpoint' to the list of REST API controllers to initialise for Messages component.
Adds 'BP_REST_Sitewide_Notices_Endpoint' for 'messages' in autoload irregular_map.

Trac ticket: https://buddypress.trac.wordpress.org/ticket/8849#ticket

#2 @imath
17 months ago

  • Milestone changed from Awaiting Review to 12.0.0
  • Version changed from 11.1.0 to 9.0.0

Hi @sjregan

Thanks a lot for your feedback and PR. Good catch, fix looks good, I'll give it a last check before committing it asap.

#3 @imath
17 months ago

Wooo, we even forgot to document the endpoint there: https://developer.buddypress.org/bp-rest-api/reference/

😱

#4 @imath
17 months ago

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

In 13435:

BP REST API: make sure the SiteWide notice endpoint is available

The corresponding REST Controller wasn't added to list of controllers to
load from the Messages component's rest_api_init() method.

Props sjregan

Closes https://github.com/buddypress/buddypress/pull/72
Fixes #8849

Note: See TracTickets for help on using tickets.