Skip to content

Last image in post content has incorrect src & srcset (substitutes from the first image) #245

Description

@LeTraceurSnork

Describe the bug
Last image from post content (post_type=post) duplicates first image of the same post (if more than one image presents) when WooCommerce enabled alongside with ilab-media-tools plugin (WordPress store link)

Here's what I did: fresh WordPress, only WooCommerce and Media Tools installed. Twentytwentyfive theme, new post, 3 images (pic rel). While plugins is disabled, I get this:
Image

When any of two plugins enabled by its own, the picture is the same, but when I enable two of them simultaneously, I get this picture:
Image

To Reproduce

  1. Install fresh WordPress
  2. Install WooCommerce and Media Tools plugin
  3. Set Media Tools up with any data (important part is to turn Enable Cloud Storage checkbox on)
  4. Create a post with at least two images in its content
  5. Open the post and ensure of the bug

Expected behavior
Last image of the post renders as it is

Screenshots
If applicable, add screenshots to help explain your problem.

Server (please complete the following information)
Server Info: Apache/2.4.62 (Debian)
PHP Version: 8.1.31
PHP Post Max Size: 8 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.88.1
OpenSSL/3.0.15
WordPress 6.7.1

How did you install the plugin?
Via composer from wpackagist

Additional context
Same issue in WooCommerce repo: woocommerce/woocommerce#56333
The bug appears only when Enable Cloud Storage checkbox is on, even if images are uploaded locally in wp-content/uploads and only when Replace URLs checkbox is on

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions