#54448 closed defect (bug) (fixed)
Missing rest api endpoint when exporting templates and template parts
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Editor | Keywords: | has-patch has-unit-tests |
Focuses: | rest-api | Cc: |
Description
In the Gutenberg plugin a rest api endpoint wp-json/__experimental/edit-site/v1/export
are added and used when you export your templates.
This endpoint are missing in 5.9 and the export function isn't working.
Steps to reproduce:
- Active twenty twenty two theme.
- Goto: Appearance > Editor (beta)
- Click on "More tools & options" (the menu in the top right corner)
- Click on "Export"
- Nothing happends. Check network and confirm the endpoint it tries to use doesn't exist.
Change History (31)
#2
@
3 years ago
- Keywords needs-patch added
@TimothyBlynJacobs Rob (@noisysocks) likely isn't online in time for 5.9 Beta 1 release today. Is this something that can be fixed before today's release?
#3
@
3 years ago
This is being worked on in https://github.com/WordPress/gutenberg/issues/36515. I'll handle the commit for it if it is ready in time.
#4
@
3 years ago
Looks like this was fixed in GB-36559. @TimothyBlynJacobs are you able to sync that trunk
at some point today?
This ticket was mentioned in PR #1936 on WordPress/wordpress-develop by Mamaduka.
3 years ago
#6
- Keywords has-patch has-unit-tests added; needs-patch removed
Part of https://github.com/WordPress/gutenberg/pull/36559
Trac ticket: https://core.trac.wordpress.org/ticket/54448
/cc @TimothyBJacobs @desrosj
3 years ago
#7
@TimothyBJacobs I'm not sure how to fix the fixtures/wp-api-generated.js
error. Can you point me to developer documentation on how to fix this?
3 years ago
#8
@Mamaduka You need to run the REST API unit tests in PHP, and then a new version of that file will get generated!
We should add an npm
script to make that easier and more clear how to accomplish that.
3 years ago
#10
Thanks for the reminder. I need to rename the method in Gutenberg, and we should be good. All methods and files are in the compat folder and have the function_exists
guard clause.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
3 years ago
peterwilsoncc commented on PR #1936:
3 years ago
#13
@Mamaduka I've merged trunk in to your branch to resolve some merge conflicts
This ticket was mentioned in Slack in #core-restapi by hellofromtonya. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
3 years ago
#16
@
3 years ago
- Keywords commit added
@TimothyBlynJacobs shared in Slack:
Looks good to me. I’d say go ahead and commit it.
Marking PR 1936 for commit
.
3 years ago
#18
Thanks for the fantastic feedback, @peterwilsoncc.
I always struggle with DocBlock comments. Now that API got merged, should I create separate PR for those.
#19
@
3 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
[52286] doesn't return the error in \WP_REST_Edit_Site_Export_Controller::permissions_check()
, only creates it. The method always returns true
. The error code also appears to be copied from \WP_REST_URL_Details_Controller
.
This ticket was mentioned in PR #2007 on WordPress/wordpress-develop by dlh01.
3 years ago
#20
Trac ticket: https://core.trac.wordpress.org/ticket/54448
This ticket was mentioned in PR #2008 on WordPress/wordpress-develop by spacedmonkey.
3 years ago
#21
Trac ticket: https://core.trac.wordpress.org/ticket/54448
#22
@
3 years ago
Good catch @dlh .
I created a patch and added some much needed until tests in #2008.
spacedmonkey commented on PR #2008:
3 years ago
#23
CC @dlh01
spacedmonkey commented on PR #2008:
3 years ago
#25
CC @Mamaduka
TimothyBJacobs commented on PR #2008:
3 years ago
#27
Great catch @dlh01, thanks for that!
This looks fine to me @spacedmonkey. If you wanted, we could consider instead making an OPTIONS
request and checking the Allow
header. That way, if the test fails, it doesn't kill the test suite execution because of the die()
call. But I think this is fine as is.
#28
@
3 years ago
- Keywords commit removed
Resetting the commit keyword which applied to the patch before the ticket was reopened.
Cc: @noisysocks. We should stabilize this endpoint first as well. Probably also should go into
wp-block-editor/v1
.