This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by emilP-4 3 weeks, 2 days ago.

Assigned support staff: Bruno.

Author Posts
September 19, 2019 at 2:29 pm

emilP-4

Subject: Diferent domains per language / Images wont load on EN, DE versions

Link to a page where the issue can be seen:
(images are missing on pages listed bellow and on some other places through website on EN, DE versions)
EN version with problem: hidden link
DE version with problem: hidden link
RS version without problem: hidden link

I expected to see: images apear on all versions of website and on all pages.

Instead, I got:Page without images, only txt.

Your colegue (Shekhar Bhandari ) finds out that this error hepened and that i need to consult my hosting provider for help.

Uncaught DOMException: Blocked a frame with origin "hidden link" from accessing a cross-origin frame.
at contents (hidden link)
at Function.map (hidden link)
at a.fn.init.n.fn.<computed> [as contents] (hidden link)
at t._moveDOMToFrame (hidden link)
at HTMLIFrameElement.<anonymous> (hidden link)
at HTMLIFrameElement.dispatch (hidden link)
at HTMLIFrameElement.r.handle (hidden link)
bundle.js?ver=3.26.5:2 Uncaught DOMException: Blocked a frame with origin "hidden link" from accessing a cross-origin frame.
at Object.$appWindow (hidden link)
at hidden link
at dispatch (hidden link)
at r.handle (hidden link)

My hosting provider send me this response (translated from serbian):
Respected,

Yes, this error only occurs when you are logged in, which is because WordPress in the admin panel uses iframes from another domain and this error occurs not with the server, but with the security features of the web browser.

The link they provided with the tutorial refers to the configuration within the .htaccess file of your site, however, this is not a good suggestion either, since the header provided there is not even supported in the Chrome browser but only in the Firefox bowser.

See a more detailed explanation of this error at the following address ... https://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame

So what happens when you are logged in is even quite normal and expected browsing behavior in your case because of the different domains where you have sites and the way WordPress displays them when you are logged in.

In any case, this is not the reason that images are not displayed to you in other languages, as they are not displayed even when you are not logged in, and then there is neither that iframe nor this error occurs.

The fact that images are not displayed on other bargains is a problem that occurs in the backend of the site, that is, for some reason, your site does not even try to place the images in the code of those translated pages.

The cause may be something in the WPML plugin or site theme or some incompatibility with another plugin, but it certainly has nothing to do with the server.

September 21, 2019 at 5:46 am #4615439

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. I can't see this CORS problem in my browser console. This could be a compatibility issue with the "Before + After Images for Divi" plugin.

Please, can I install the Duplicator plugin (or All in One Migration) to make a copy of your site and install it on my test environment? This will help me debug the problem.

Thank you.

September 22, 2019 at 7:18 pm #4619349

emilP-4

Yes, you can. Fell free to do anything that will resolve this problem.

September 24, 2019 at 2:52 am #4627531

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you. I've installed All in One Migration plugin and I did a copy of your site. I will install it on my test environment and soon I will contact you.

Thank you.

September 24, 2019 at 11:38 am #4631199

emilP-4

Ok Bruno, thank you. Let me know what was the problem as soon as you can.

September 24, 2019 at 5:45 pm #4633301

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

To ensure that this plugin is made compatible with WPML we need to contact the plugin author and work with him on resolving the issue.

I have forwarded the details to our Themes & Plugins Compatibility Team and they will contact the author. Our Compatibility Team will work with the author of the plugin for this to work properly.

Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.

Thank you.

September 25, 2019 at 1:27 pm #4639107

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Our compatibility team is suggesting a workaround for your site to work properly:

- In wp-content/plugins/before-after-images-for-divi/includes/modules/BeforeAfterImage/BeforeAfterImage.php replace line 265:

$src_id = attachment_url_to_postid( $src );

with:

$current_lang = apply_filters( 'wpml_current_language', NULL );
do_action( 'wpml_switch_language', apply_filters( 'wpml_default_language', NULL ) );
$src_id = attachment_url_to_postid( $src );
do_action( 'wpml_switch_language', $current_lang );

Please, could you check if following the steps above the problem is solved?

Thank you.

September 25, 2019 at 8:57 pm #4642045

emilP-4

My issue is resolved now with that piece of code. Thank you!