MEC - Images missing in slider

I found a problem in the MEC slider shortcode; Images with french characters in the url are not showing (ok in all other shortcodes)

For example:

SLIDER: url KO:

CAROUSEL: url OK

<img src="http://lpoupart.com/wp-content/uploads/2017/12/bande-marché-de-Noël-900x225-474x225.jpg" class="attachment-meccarouselthumb size-meccarouselthumb wp-post-image" alt="" data-mec-postid="1909" width="474" height="225">

Is there another solution than renaming my images?

Hello There,

Thanks for writing in! It is not MEC’s issue. It is with WordPress. When you upload a file or an image file with a filename that has unique character, WordPress will try to convert that character into something else. For example, you have uploaded your image and WordPress will rename it to this:

http://lpoupart.com/wp-content/uploads/2017/12/bande-march%C3%A9-de-No%C3%ABl-900x225-474x225.jpg

The character were change to an acceptable character into a format that can be transmitted and readable by the browser as a url. It is best that you refrain from using any character that doesn’t belong with the alphanumeric alphabet. Use only the safe characters. For more details about URL encoding, please check this links:
https://www.w3schools.com/tags/ref_urlencode.asp
https://perishablepress.com/stop-using-unsafe-characters-in-urls/

Hope this helps.

I don’t agree that this is not an MEC’s issue, but maybe I am wrong!

The same image has a correct url everywehe including in the media library:

http://lpoupart.com/wp-content/uploads/2017/12/bande-marché-de-Noël-900x225.jpg

http://lpoupart.com/wp-content/uploads/2017/12/bande-marché-de-Noël-900x225.jpg

It is only in the slider shortcode that it is wrong.

Hello There,

This could be a bug with MEC. We will be reporting this. Meanwhile, to avoid such issue, please refrain from using any invalid character which may not be acceptable as filename or might need url encoding.

Thank you for your understanding.

Just for information:

It can be corrected with a small change in slider/render.php to use wordrpess function to get the url for $src :

            // get src attr from img
            // $doc = new DOMDocument();
            // $doc->loadHTML($event->data->thumbnails['large']);
            // $xpath = new DOMXPath($doc);
            // $src = $xpath->evaluate("string(//img/@src)"); 

            $src = get_the_post_thumbnail_url($event->ID, 'large'); 

(in comment is the code replaced by the last line!)

Hi there,

Thank you for the information. We will add this to the issue tracker so that then we report to MEC developers as a support request.

Thank you for your contribution.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.