Skip to content

Commit

Permalink
Merge pull request #20743 from Yoast/1091-major-errors-in-case-post-w…
Browse files Browse the repository at this point in the history
…as-created-in-elementor-and-switched-to-block-editor

Fix major errors in case post was created in elementor and switched to block editor
  • Loading branch information
agnieszkaszuba authored Oct 9, 2023
2 parents 61cb59a + e4e3421 commit 8b06dd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/js/src/analysis/collectAnalysisData.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default function collectAnalysisData( editorData, store, customAnalysisDa
// Retrieve the block editor blocks from WordPress and filter on useful information.
let blocks = null;
if ( blockEditorDataModule ) {
blocks = blockEditorDataModule.getBlocks();
blocks = blockEditorDataModule.getBlocks() || [];
blocks = blocks.filter( block => block.isValid );
}

// Make a data structure for the paper data.
Expand Down
2 changes: 1 addition & 1 deletion packages/yoastseo/src/pluggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Pluggable.prototype._reloaded = function( pluginName ) {
* @param {string} pluginName The plugin that is registering the modification.
* @param {number} priority (optional) Used to specify the order in which the callables associated with a particular filter are called.
* Lower numbers correspond with earlier execution.
* @returns {boolean} Whether or not applying the hook was successfull.
* @returns {boolean} Whether or not applying the hook was successful.
*/
Pluggable.prototype._registerModification = function( modification, callable, pluginName, priority ) {
if ( typeof modification !== "string" ) {
Expand Down

0 comments on commit 8b06dd5

Please sign in to comment.