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

DUPP-33 Fix scheduled republish bug #218

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

enricobattocchi
Copy link
Member

@enricobattocchi enricobattocchi commented Dec 15, 2021

Context

  • We want to fix a bug where HTML tags in a Custom HTML block are stripped away whem a R&R copy is republished.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where HTML tags in a Custom HTML block would be removed when republishing a scheduled Rewrite & Republish copy.

Relevant technical choices:

  • Also removes an unnecessary wp_slash call around a WP_Post object (wp_update_post() will take care of that)

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Create a new post in the block editor
  • add a Custom HTML block and insert some code with tags like script and style, e.g.:
<style>
.whatever {
   font-size: 35px;
}
</style>
<script>
alert(1);
</script>
  • Publish the post
    • visit it in the front end and check that you can see the tags in the source (if you use the example above you'll also get an alert)
  • create a R&R copy from that post
    • change the title and something from the content, but don't change the Custom HTML block!
  • schedule republish to 2 minutes in the future
  • wait ⏳
  • when the copy has been republished, check the original post
    • see that the changes have been applied
    • check that the tags have not been removed

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Documentation

  • I have written documentation for this change.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes DUPP-33

@karlijnbok karlijnbok added this to the 4.4 milestone Dec 16, 2021
@karlijnbok
Copy link
Contributor

CR & Acceptance: 👍

@karlijnbok karlijnbok merged commit f565965 into trunk Dec 16, 2021
@karlijnbok karlijnbok deleted the DUPP-33-fix-scheduled-republish-bug branch December 16, 2021 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants