From 6834e53ccfbb39d253048f0190c854bd83b4f6ce Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Mon, 27 May 2024 14:18:49 +0300 Subject: [PATCH 1/2] fix: use the user defined custom image tag --- includes/admin/feedzy-rss-feeds-import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index f9e036d5..33c9aa07 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -1652,7 +1652,7 @@ private function run_job( $job, $max ) { $image_source_url = ''; $img_success = true; $new_post_id = 0; - $default_img_tag = ! empty( $import_featured_img ) ? '[#item_image]' : ''; + $default_img_tag = ! empty( $import_featured_img ) && is_string( $import_featured_img ) ? $import_featured_img : ''; // image tag if ( strpos( $default_img_tag, '[#item_image]' ) !== false ) { @@ -1759,7 +1759,7 @@ function( $term ) { do_action( 'feedzy_import_extra', $job, $item_obj, $new_post_id, $import_errors, $import_info ); - $default_img_tag = ! empty( $import_featured_img ) ? '[#item_image]' : ''; + $default_img_tag = ! empty( $import_featured_img ) && is_string( $import_featured_img ) ? $import_featured_img : ''; if ( ! empty( $default_img_tag ) && 'attachment' !== $import_post_type ) { $image_source_url = ''; $img_success = true; From 1daf2ed920cf034e9deaec04641811d6ebebf5f3 Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Mon, 27 May 2024 14:34:37 +0300 Subject: [PATCH 2/2] fix: E2E test image tag --- cypress/e2e/default/import_feed_free.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/default/import_feed_free.js b/cypress/e2e/default/import_feed_free.js index 830c976e..8845fa6e 100644 --- a/cypress/e2e/default/import_feed_free.js +++ b/cypress/e2e/default/import_feed_free.js @@ -54,7 +54,7 @@ describe('Test Free - Import Feed', function() { cy.get('[name="feedzy_meta_data[import_post_title]"]').clear({force: true}).invoke('val', PREFIX + feed.title).blur({force: true}); cy.get('[name="feedzy_meta_data[import_post_content]"]').clear({force: true}).invoke('val', PREFIX + feed.fullcontent.content + feed.content).blur({force: true}); - cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').clear({force: true}).invoke('val', feed.image.url).blur({force: true}); + cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').clear({force: true}).invoke('val', feed.image.tag).blur({force: true}); // check disallowd magic tags const tags = feed.tags.disallowed; @@ -122,7 +122,7 @@ describe('Test Free - Import Feed', function() { cy.get('[name="feedzy_meta_data[import_post_content]"]').should('have.value', PREFIX + feed.fullcontent.content + feed.content + '\n'); // image from URL - cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').should('have.value', feed.image.url); + cy.get('[name="feedzy_meta_data[import_post_featured_img]"]').should('have.value', feed.image.tag); // publish cy.get('button[type="submit"][name="publish"]').scrollIntoView().click({force:true});