Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Ensure that all *.asset.php files are included in plugin.zip #34875

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Sep 16, 2021

Description

Fixes a bug reported by @aaroncampbell in #33082 (comment):

I'm still seeing this on WP 5.9-alpha-51272-src with Gutenberg 11.4.1. It looks like it's looking for a gutenberg/build/block-library/blocks/file/view.min.asset.php but no *.asset.php file exists there? Same with with navigation block and probably others although those are the two triggering notices on the plugins page when I click activate.

Core appends the asset.php, and the core blocks seem to have files named accordingly.

How has this been tested?

I executed the command that generates the gutenberg.zip file:

./bin/build-plugin-zip.sh

I checked if the asset files get included:

Screen Shot 2021-09-16 at 14 22 45

The same File block looks like this in the build folder:
Screen Shot 2021-09-16 at 13 57 36

Types of changes

Bug fix (non-breaking change which fixes an issue).

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@gziolo gziolo self-assigned this Sep 16, 2021
@gziolo gziolo added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended labels Sep 16, 2021
@gziolo gziolo requested a review from a team September 16, 2021 12:30
@@ -113,8 +113,7 @@ build_files=$(
ls build/*/*.{js,css,asset.php} \
build/block-library/blocks/*.php \
build/block-library/blocks/*/block.json \
build/block-library/blocks/*/*.css \
build/block-library/blocks/*/*.js \
build/block-library/blocks/*/*.{js,css,asset.php} \
build/edit-widgets/blocks/*/block.json \
build/widgets/blocks/*.php \
Copy link
Member

@noisysocks noisysocks Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to change this line too?

Copy link
Member Author

@gziolo gziolo Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It warns when files are not present:

Screen Shot 2021-09-17 at 10 10 10

I think this is why the list for edit-widgets and widgets is shorter.

I would appreciate if we could use the following:

build_files=$(
	ls build/*/*.{js,css,asset.php} \
	build/{block-library,edit-widgets,widgets}/blocks/*.php \
	build/{block-library,edit-widgets,widgets}/blocks/*/block.json \
	build/{block-library,edit-widgets,widgets}/blocks/*/*.{js,css,asset.php} \
)

Unless there is a nice way to hide those warnings.

@gziolo gziolo merged commit 44ed70a into trunk Sep 17, 2021
@gziolo gziolo deleted the fix/plugin-zip-block-view-asset branch September 17, 2021 08:42
@github-actions github-actions bot added this to the Gutenberg 11.6 milestone Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants