-
Notifications
You must be signed in to change notification settings - Fork 21
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
bugfix: content in acf-fields was not included in analyses. #329
bugfix: content in acf-fields was not included in analyses. #329
Conversation
js/src/collect/collect-v5.js
Outdated
// Check whether classic editor is used. | ||
if ( isTinyMCEAvailable( "content" ) ) { | ||
acfFields = acf.get_fields(); | ||
} else { | ||
// Assume Gutenberg is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in this thread, we already have a reliable method to know whether the editor is Gutenberg or not, by accessing window.wpseoScriptData.isBlockEditor
. If we can use this in this check, it means that we wouldn't need to duplicate the helper logic for tinyMCE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in this file js/src/collect/collect-v5.js
, we have another check that uses wp.data.select( "core/block-editor" )
(line 44). I think it's safer that we also change that check :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in this thread, we already have a reliable method to know whether the editor is Gutenberg or not, by accessing window.wpseoScriptData.isBlockEditor. If we can use this in this check, it means that we wouldn't need to duplicate the helper logic for tinyMCE.
Agreed! I adapted it. We do not have to reset the variable in yoast-acf-analysis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in this file js/src/collect/collect-v5.js, we have another check that uses wp.data.select( "core/block-editor" ) (line 44). I think it's safer that we also change that check :)
Disagreed: unlike the check that we changed, this check is not primarily aimed ad checking which editor is active. It primarily checks if the core/block-editor
is available (not undefined) so that it can safely call var blocks = wp.data.select( "core/block-editor" ).getBlocks();
a few lines later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good 🤝
I suggested some comment improvements :)
Co-authored-by: Aida Marfuaty <48715883+FAMarfuaty@users.noreply.github.com>
Co-authored-by: Aida Marfuaty <48715883+FAMarfuaty@users.noreply.github.com>
Thank you for the suggestions, agreed. I committed them. |
Acceptance test 💯
|
Summary
This bug was caused by wordproof being activated for a yet unknown reason.
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
This PR can be tested by following these steps:
NOTE: highlighting is not possible in custom fields. This is known. This issue was created for that.
Prep
19508-the-content-in-acf-fields-is-not-detected-for-analysis-when-classic-editor-is-used
composer install
yarn
yarn build
(NOTE: notgrunt build
)custom fields
text area
Test analyses
(Minimum of 300 words such as to be sure that all analyses are available).
Passive voice
The cat was greeted by the dog.
Inclusive language
midget
.Keyphrase analyses
apple
as the keyphrase.apple
to the custom field.Paragraph length
Test compatibility with previous wordpress versions
This bug was probably caused by a change in wordpress core. So it is good to confirm it still works with older versions.
Test with wordproof disabled
Test block editor.
Make sure that the behaviour in the block editor is not affected.
Repeat with Page and woo-product.
Fixes #19508