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

Re-introduce woocommerce_product_csv_importer_check_import_file_path as deprecated #32756

Merged
merged 2 commits into from Apr 26, 2022

Conversation

Konamiman
Copy link
Contributor

The hook was inadvertendlty removed in PR #32460.
Reintroducing it as a deprecated hook in favor of
woocommerce_csv_importer_check_import_file_path.

All Submissions:

Changes proposed in this Pull Request:

The woocommerce_product_csv_importer_check_import_file_path was inadvertently removed in #32460. Here we reintroduce it but as deprecated hook.

How to test the changes in this Pull Request:

  1. Add this snippet to the WooCommerce code, for example in woocommerce.php:
function test_hook_deprecation(){
	add_filter('woocommerce_product_csv_importer_check_import_file_path', function ($value) {
		echo("Old filter called with: $value\n");
		return $value . '_modified';
	});

	$value = apply_filters('woocommerce_csv_importer_check_import_file_path', 'thefilename');
	echo("Result of the new filter call: $value\n");
};
  1. Execute the code with wp eval 'test_hook_deprecation();', you should get the following:
PHP Deprecated:  woocommerce_product_csv_importer_check_import_file_path is <strong>deprecated</strong> since version 6.5.0! Use woocommerce_csv_importer_check_import_file_path instead. in /home/konamiman/wordpress/wp-includes/functions.php on line 5691
Old filter called with: thefilename
Result of the new filter call: thefilename_modified

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you created a changelog file by running pnpm nx affected --target=changelog?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

The hook was inadvertendlty removed in PR #32460.
Reintroducing it as a deprecated hook in favor of
woocommerce_csv_importer_check_import_file_path.
@Konamiman Konamiman self-assigned this Apr 25, 2022
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 25, 2022
@Konamiman Konamiman added the release: cherry-pick Commits from this PR also needs to be added to current release branch. label Apr 25, 2022
@Konamiman Konamiman marked this pull request as ready for review April 25, 2022 09:32
@Konamiman Konamiman added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Apr 25, 2022
@Konamiman Konamiman requested review from a team and jorgeatorres and removed request for a team April 25, 2022 09:33
@Konamiman
Copy link
Contributor Author

Hi @jorgeatorres, note that this PR is blocked until we confirm if this is really going into Woo 6.5 (if not it will require changes), so please don't merge yet.

Copy link
Contributor

@claudiosanches claudiosanches left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@claudiosanches claudiosanches merged commit d880da0 into trunk Apr 26, 2022
@claudiosanches claudiosanches deleted the fix/hook_removal_from_32460 branch April 26, 2022 21:23
@github-actions github-actions bot added this to the 6.6.0 milestone Apr 26, 2022
@github-actions
Copy link
Contributor

Hi @claudiosanches, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. status: blocked The issue is blocked from progressing, waiting for another piece of work to be done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants