This PR can be summarized in the following changelog entry:
Fixes a bug where notices would not be appearing in the block editor, throwing console errors, with some locales.
Relevant technical choices:
*
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Reproduce the problem
use the latest released version (or main)
switch WP to Italian, this ensures that the translated string has an ' which breaks the parsing
keep the console open
create a Rewrite & Republish copy of a published post
see that when you are redirected to the Editor you don't see any notice
see that you get a JS error in the console: Uncaught ReferenceError: duplicatePostNotices is not defined
edit the post
click on "Ripubblica" ("Republish"), also in the pre-publish confirmation sidebar
see that you are not redirected to the republished post but you stay in the same screen and you get a notification telling that the draft has been saved
navigate to the post list and see that the republishing actually happened anyway
Test the fix
switch to this branch
switch WP to Italian, this ensures that the translated string has an '
keep the console open
create a Rewrite & Republish copy of a published post
see that when you are redirected to the Editor you see a notice
Ora puoi iniziare a riscrivere il tuo articolo in questo duplicato dell'originale. Se fai clic su "Ripubblica", questo articolo riscritto sostituirà l'originale.
see that you don't get a JS error in the console
edit the original post
see that when you are redirected to the Editor you see a notice
È stato creato un duplicato di questo articolo. Tieni in considerazione che ogni modifica che fai a questo articolo sarà sostituita quando la versione duplicata sarà ripubblicata.
see that you don't get a JS error in the console
make a change in the original post and click "Aggiorna" ("Update")
edit the R&R copy
see that you see a notice
L'articolo originale è stato nel frattempo modificato. Se fai clic su "Ripubblica", questo articolo riscritto sostituirà l'originale.
see that you don't get a JS error in the console
change the date of the post to a future date and hit "Programma la ripubblicazione..." ("Schedule republishing")
edit the original post
see that when you are redirected to the Editor you see a notice
È stato creato un duplicato di questo articolo, che dovrebbe sostituire questo articolo in data Maggio 18, 2024 alle ore 3:59 pm.
see that you don't get a JS error in the console
edit the R&R copy
change the date of the post to "Ora" ("Now") or to a past date and hit "Ripubblica" ("Republish")
see that you are redirected to the edit screen
See that you see a notice
Il tuo articolo originale è stato sostituito con l'articolo riscritto. Stai ora visualizzando l'articolo originale (riscritto).
see that you don't get a JS error in the console
Relevant test scenarios
[x] Changes should be tested with the browser console open
[ ] Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
[ ] Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
[ ] Changes should be tested on different browsers
[ ] Changes should be tested on multisite
Test instructions for QA when the code is in the RC
[x] 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. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.
Quality assurance
[x] I have tested this code to the best of my abilities
[x] I have added unittests to verify the code works as intended
Innovation
[x] No innovation project is applicable for this PR.
[ ] This PR falls under an innovation project. I have attached the innovation label and noted the work hours.
Context
*
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
*
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Reproduce the problem
main
)'
which breaks the parsingUncaught ReferenceError: duplicatePostNotices is not defined
Test the fix
'
Ora puoi iniziare a riscrivere il tuo articolo in questo duplicato dell'originale. Se fai clic su "Ripubblica", questo articolo riscritto sostituirà l'originale.
È stato creato un duplicato di questo articolo. Tieni in considerazione che ogni modifica che fai a questo articolo sarà sostituita quando la versione duplicata sarà ripubblicata.
L'articolo originale è stato nel frattempo modificato. Se fai clic su "Ripubblica", questo articolo riscritto sostituirà l'originale.
È stato creato un duplicato di questo articolo, che dovrebbe sostituire questo articolo in data Maggio 18, 2024 alle ore 3:59 pm.
Il tuo articolo originale è stato sostituito con l'articolo riscritto. Stai ora visualizzando l'articolo originale (riscritto).
Relevant test scenarios
Test instructions for QA when the code is in the RC
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
Documentation
Quality assurance
Innovation
innovation
label and noted the work hours.Fixes #