Open highbelt opened 3 years ago
Seems like word count is not working for „nested“ inner blocks (https://www.advancedcustomfields.com/resources/acf_register_block_type/, „Adding inner blocks“) as the current implementation excludes the parent/embedding blocks.
e.g. https://github.com/Yoast/yoast-acf-analysis/blob/48b01c7181d5c838e5189a8d68b9692c403dd0e2/js/yoast-acf-analysis.js#L245 and https://github.com/Yoast/yoast-acf-analysis/blob/48b01c7181d5c838e5189a8d68b9692c403dd0e2/js/src/collect/collect-v5.js#L44
jQuery( '[data-block="${block.clientId}"] .acf-block-preview' ).length in this case returns > 1 and the block will be ignored.
jQuery( '[data-block="${block.clientId}"] .acf-block-preview' ).length
Changing the condition to .length >= 1 fixed it for me - not knowing, if this breaks somewhere else. 🤷 Is there a reason why it is set to === 1?
.length >= 1
=== 1
All contents should be recognized, even if nested in another block
Please give us a description of what happened.
Seems like word count is not working for „nested“ inner blocks (https://www.advancedcustomfields.com/resources/acf_register_block_type/, „Adding inner blocks“) as the current implementation excludes the parent/embedding blocks.
e.g. https://github.com/Yoast/yoast-acf-analysis/blob/48b01c7181d5c838e5189a8d68b9692c403dd0e2/js/yoast-acf-analysis.js#L245 and https://github.com/Yoast/yoast-acf-analysis/blob/48b01c7181d5c838e5189a8d68b9692c403dd0e2/js/src/collect/collect-v5.js#L44
jQuery( '[data-block="${block.clientId}"] .acf-block-preview' ).length
in this case returns > 1 and the block will be ignored.Changing the condition to
.length >= 1
fixed it for me - not knowing, if this breaks somewhere else. 🤷 Is there a reason why it is set to=== 1
?Please describe what you expected to happen and why.
All contents should be recognized, even if nested in another block
How can we reproduce this behavior?
Technical info