#45396 closed defect (bug) (fixed)
Import from JSON button is missing on Manage All Reusable Blocks page
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.0 | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
The Import from JSON button is missing on the Manage All Reusable Blocks page and the Export as JSON link underneath each reusable block does not work.
Steps to reproduce
- Create a new post
- Create a new reusable block
- Click on the More button (top right) and select Manage All Reusable Blocks
Expected result
There should be a blue Import from JSON button at the top of the WP Admin page.
Attachments (3)
Change History (22)
#2
@
7 years ago
- Keywords reporter-feedback added
@noisysocks In WP version 5.0-beta5-43909 is already working without applying above patch. see attached screenshot.
I am missing anything?
#3
follow-up:
↓ 4
@
7 years ago
I think it's a very recent regression. To clarify, I encountered it while running r43933 in the 5.0 branch.
#4
in reply to:
↑ 3
@
7 years ago
- Keywords reporter-feedback removed
Ok. so if above issue fix already then can you please close this ticket or needs to wait?
Replying to noisysocks:
I think it's a very recent regression. To clarify, I encountered it while running r43933 in the 5.0 branch.
#5
@
7 years ago
The issue hasn't been fixed. It exists in the 5.0 development branch. We can't close this ticket until it's fixed by e.g. committing the patch I've attached above.
#8
@
7 years ago
- Keywords fixed-5.0 added
- Resolution fixed deleted
- Status changed from closed to reopened
#9
follow-up:
↓ 10
@
7 years ago
Don't you lose the version number when enqueuing the script that way? Why not just set $scripts->add_data( 'wp-list-reusable-blocks', 'group', 1 );
in script-loader.php
instead?
#10
in reply to:
↑ 9
@
7 years ago
Replying to swissspidy:
Don't you lose the version number when enqueuing the script that way? Why not just set
$scripts->add_data( 'wp-list-reusable-blocks', 'group', 1 );
inscript-loader.php
instead?
I wrote the patch the only way I know how—I'm not too familiar with these APIs 🙂
Looking at the source for wp_enqueue_script
, it seems to me that calling wp_enqueue_script()
with $src = ''
and $in_footer = true
will have the same effect as setting $script->add_data( 'wp-list-reusable-blocks', 'group', 1 );
in script-loader.php
. Is there something I'm missing?
#11
@
7 years ago
The problem with that approach is that for everyone who adds wp-list-reusable-blocks
as a dependency or directly calls wp_enqueue_script( 'wp-list-reusable-blocks' )
the script would still load in the header.
That's why this ($script->add_data( 'wp-list-reusable-blocks', 'group', 1 );
should be added directly to the wp_default_packages_scripts
function.
#12
@
7 years ago
- Keywords fixed-5.0 removed
Thanks for following up on this, and the patch, @swissspidy!
45396.2.diff is good to commit.
#13
@
7 years ago
Please correct me if I'm mistaken, but I'd hold off commit until the action on #45402 has been decided as that one includes a revert for this.
#14
@
7 years ago
- Keywords fixed-5.0 added
Yah, I just caught up. :) Re-closing this in favour of #45402.
I've fixed this in 45396.diff by moving
wp-list-reusable-blocks
to theedit.php
page's footer.