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

Correctly stop further execution when autoloader is missing #3237

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

swissspidy
Copy link
Collaborator

Summary

This is a follow-up to #1234 / #2962. A small oversight that happened when refactoring that PR.

Basically, the goal is this:

  1. When the autoloader is missing (e.g. ! class_exists( '\Google\Web_Stories\Plugin' ) === true) report error in both WordPress admin and the terminal.
  2. When JS files are missing (e.g. ! file_exists( WEBSTORIES_PLUGIN_DIR_PATH . '/assets/js/edit-story.js' ) === true) report error in WordPress admin.
  3. When the autoloader is missing stop further execution to prevent fatal errors, in both WordPress admin and the terminal.

Previously, the last step only worked in CLI context but not in WordPress admin.

This PR restores expected behavior.


Fixes #3231

@swissspidy swissspidy added Type: Bug Something isn't working Group: WordPress Changes related to WordPress or Gutenberg integration Pod: WP & Infra labels Jul 16, 2020
@swissspidy swissspidy requested a review from spacedmonkey July 16, 2020 17:20
@github-actions
Copy link
Contributor

github-actions bot commented Jul 16, 2020

Size Change: 0 B

Total Size: 1.08 MB

ℹ️ View Unchanged
Filename Size Change
assets/css/edit-story.css 269 B 0 B
assets/css/stories-dashboard.css 305 B 0 B
assets/css/web-stories-embed-block.css 515 B 0 B
assets/js/edit-story.js 470 kB 0 B
assets/js/stories-dashboard.js 541 kB 0 B
assets/js/web-stories-activation-notice.js 55.8 kB 0 B
assets/js/web-stories-embed-block.js 16.4 kB 0 B

compressed-size-action

@swissspidy swissspidy force-pushed the fix/run-from-source-check-logic branch from de880af to 6ee628e Compare July 16, 2020 17:32
@codecov

This comment has been minimized.

@swissspidy swissspidy changed the base branch from master to main July 20, 2020 10:19
@swissspidy
Copy link
Collaborator Author

@spacedmonkey could you please review?

Copy link
Contributor

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

👍

@swissspidy swissspidy merged commit e12aac2 into main Jul 21, 2020
@swissspidy swissspidy deleted the fix/run-from-source-check-logic branch July 21, 2020 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: WordPress Changes related to WordPress or Gutenberg integration Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot activate the web-stories-wp master in WordPress
3 participants