• Resolved MrOrsh

    (@mrorsh)


    Apart from that I have to do the wp-upload directory separtely because it´s too big everything seems to work fine doing some test backups and installs. I however have lots of pictures that uses the srcset to display a smaller version of some pictures. The srcset-link gets updated, but it gets updated wrongly.

    Some images display correctly (that aren´t using the srcset-code). The actual image-link (src) is correct on both images and looks like:
    src="http://localhost/test/wp-content/uploads/2016/11/picture.jpg

    However the srcset pictures also have the correct src-path, but the srcset-path (that actually displays the image) gets this path:
    srcset="http://localhost/test/C:/xampp/htdocs/test/wp-content/uploads/2016/11/picture.jpg

    They get the “C:/xampp/htdocs/test” added into the path, and that makes them not visible at all.

    Could I be doing something wrong during the setup process. Right now I pretty much left the settings on auto 🙂

    Very greatful for every little bit of help I can get :-/ Thanks in advance

Viewing 11 replies - 1 through 11 (of 11 total)
  • That is odd… Is it possible that those values are dynamic. In other-words are the srcset attributes driven from a PHP variable, possible something in your functions.php file? Can you open the database.sql file and validate what they look like before step 2 of the installer runs?

    Thxs

    Thread Starter MrOrsh

    (@mrorsh)

    I´m gonna try and check the database.sql as soon as I can!

    I checked with the theme creators and it´s not a theme function since the srcset is built in to wordpress nowdays.

    Could it have something to do with that I tried to use the copy on localhost (xampp installation) instead of an actual host?

    I don’t think so. Users copy sites from localhost to prod and back all the time. The fact that one element works and the other doesn’t indicates that something else is driving the srcset attribute like a dynamic variable or something. I haven’t ever really seen this issue so I’m not 100% sure to be honest.

    Thread Starter MrOrsh

    (@mrorsh)

    This is how the installer looks like before step 2: http://i65.tinypic.com/21kcfp0.png

    Does it look right?

    • This reply was modified 9 years, 5 months ago by MrOrsh.

    That looks pretty standard when going from linux to windows. The way the installer works is that it will find all of the Old Settings Path and replace it with the new settings path. So your srcset must have been pointing at /sotrage/conntent/91/… on the linux box, which doesn’t seem like a correct path for an image?

    Thread Starter MrOrsh

    (@mrorsh)

    If i look at the srcset-link on the actual page it is displayed correctly as:
    srcset="http://www.page.se/wp-content/uploads/2016/11/picture.jpg

    There is an option for setting the page-url again under Advanced Options. But the only thing that works there is to leave it as the installer suggests (http://localhost/offline).

    Can´t att all see where the added “C:/xampp/htdocs/” comes from! Been trying to go through my plugins and everything but can´t figure anything out :-/

    The pictures that doesn´t use the srcset-attribute (that doesn´t need any kind of resizing) displays correctly. So the issue must be somewhere in the srcset… Making my head in 😛

    Hey @mrorsh,

    If you want to submit a support ticket for this issue I can have a closer look at your setup when I get some free time at this point I don’t know source of the issue… Please provide a link to this thread when submitting the ticket.

    Thanks~

    Thread Starter MrOrsh

    (@mrorsh)

    I´ll support a ticket if I can´t figure it out 🙂

    Stumbled across this question: https://wordpress.org/support/topic/images-srcset/ where someone has had the same issue. There the problem was solved with enabling rewrite_module in wamp. However in XAMPP it is already enabled so that didn´t really help me.

    I have also seen that my featuerd pictures for articles too get the same “wrong” img-link. So they don´t display at all, even though they are not using the scrset attribute. So the problem doesn´t seem to be the srcset-attribute. Rather the faulty link structure seem to get applied to the images that have been somehow rezised (and/or using the srcset attribute).

    I was able (as a test) to remove the whole srcset attribute from the images all together by using this code (and making the images appear):

    function meks_disable_srcset( $sources ) {
        return false;
    }
     
    add_filter( 'wp_calculate_image_srcset', 'meks_disable_srcset' );

    However this didn´t solve the original problem. I know you wrote you didn´t really know what could be causing it. Just thought I´d ad in som more data to the conversation anyway 🙂

    That’s were I have been lead to think that there is a filter/hook that may be trying to perform the update for you. My suspicion is that there really isn’t anything Duplicator can do to fix these types of issues as they are process by code somewhere else and sometimes they can be tricky to track down…

    Thread Starter MrOrsh

    (@mrorsh)

    Just wanted to give an update on this, and ask a follow-up-question.

    I (FINALLY!) managed to solve the problem creating (as far as I can see) a perfect clone backup of my site on a localhost. I did this by completely removing the “Path” under “New settings” (leaving it blank). To use the picture below as reference I completely removed the text:
    C:/xampp/htdocs/offline

    I am however unsure of this possibly can do anything to mess up the site? Does the Path under New Settings need to be set? It seems like everything is working 100% as it is supposed to. Featured images showing and all. But I get a bit unsure since I guess the “Path” under “New Settings” is there for a reason?

    Thanks

    That is good news, thanks for the update… The Path setting will remap the path from your old site to that new site. The new path is set based on the location for where you placed the installer. This is traditionally the most common location for this setting, this is why it defaults to that value. In your case it looks like your web server doesn’t have that value mapped for one reason or another. That value can also be mapped in your Apache web server.

    Cheers~

    • This reply was modified 9 years, 4 months ago by Cory Lamle.
Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘srcset img links not getting the correct link’ is closed to new replies.