WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#39672 closed defect (bug) (worksforme)

REST API: Backbone URLs don't work correctly without pretty permalinks

Reported by: rmccue Owned by: adamsilverstein
Milestone: Priority: normal
Severity: normal Version:
Component: REST API Keywords: reporter-feedback
Focuses: javascript Cc:
PR Number:

Description

Looks like permalinks are built incorrectly when using ugly URLs (base is http://example.com/?rest_route=/)

Change History (5)

#1 @adamsilverstein
3 years ago

  • Keywords reporter-feedback added
  • Owner set to adamsilverstein
  • Status changed from new to reviewing

@rmccue Thanks for the bug report. As far as I can tell, the client works correctly without pretty permalinks, can you give some more details and describe the steps to reproduce?

Here is what I did to test:

  • Reset permalinks to 'plain'
  • sessionStorage.clear()
  • no other changes, reload page with wp-api dependency added

Testing api with the console, the client loads the schema and parses correctly. I fetch posts successfully:

https://cl.ly/302r042F3i3D/Image%202017-01-24%20at%203.04.45%20PM.png

Create a post draft:
https://cl.ly/2R0p1w3i0b3G/wpdev__Just_another_WordPress_site_2017-01-24_15-09-51.jpg

Last edited 3 years ago by adamsilverstein (previous) (diff)

#2 @adamsilverstein
3 years ago

  • Keywords close added

@rmccue can you verify this is an issue, in my testing the client works correctly without pretty permalinks. Any steps to reproduce?

#3 @rmccue
3 years ago

Potentially this was because I already had the schema cached in sessionStorage, then changed the permalink scheme. Haven't reproduced yet, so cannot say for certain.

#4 @adamsilverstein
3 years ago

Ok, I'll leave this ticket open for now, if you can't reproduce or see recur, please close.

#5 @rmccue
2 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from reviewing to closed

Let's close this out, I haven't noticed it again so likely a caching issue.

Note: See TracTickets for help on using tickets.