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

Quality: Fix warning error when exporting theme #671

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

t-hamano
Copy link
Contributor

I discovered this while investigating issue #612.

c6db5435c8ed263e31927ac5468c8232.mp4

I don't know the exact cause, but it seems that this problem can be solved by adding an exit; to the end of the callback function.

The exit; also exists in the core export function.

Testing Instructions

  • Add define( 'WP_DEBUG_LOG', true ); to the wp-config.php.
  • Confirm that no PHP errors are logged when you export the theme.

URL.revokeObjectURL( url );
}, 100 );
}
downloadBlob( filename, blob, 'application/zip' );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a minor refactoring. With this change, we no longer check if the browser is IE, but this should not be a problem since WordPress itself does not support IE.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was actually unfamiliar with msSaveBlob until looking into this change. Likewise WordPress' implementation of the anchor downloading technique so I'm happy to replace that. It works as expected.

Thank's for cleaning that up.

@pbking
Copy link
Contributor

pbking commented Jun 10, 2024

I don't know the exact cause, but it seems that this problem can be solved by adding an exit; to the end of the callback function.

Yes, I believe that in other "export" logic we have had in CBT we likewise called exit for that reason. It seems that wasn't carried over back when that transitioned to the logic we have now.

Thank you for cleaning that up.

@t-hamano t-hamano merged commit 58fed31 into trunk Jun 10, 2024
2 checks passed
@t-hamano t-hamano deleted the quality/export-theme-warning branch June 10, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants