syamilmj / Aqua-Resizer

Resize WordPress images on the fly
502 stars 208 forks source link

Bug with WPML #61

Open vukvukovich opened 9 years ago

vukvukovich commented 9 years ago

There is the problem when "domain per language" option is selected in WPML.

ex. domain.local and en.domain.local.

In that case function is returning "false".

amitkvint commented 8 years ago

Is there any chance you could look into that? We can help if needed.

senlin commented 8 years ago

tbh this doesn't make much sense @vukvukovich as your issue is of almost 6 months ago, care to explain, does it still exist?

vukvukovich commented 8 years ago

@senlin Issue is still present, but it is caused by a bug in WPML.

The problem is because of not handling wp_upload_dir() & content_url() functions.

senlin commented 8 years ago

@vukvukovich Have you opened a bug report with WPML? Usually they are very cooperative when you file a report with detailed information so they can reproduce the issue.

amitkvint commented 8 years ago

@senlin - @vukvukovich is a WPML developer. He is referring to an inner ticket we have waiting to be fixed for one of our next WPML releases.

senlin commented 8 years ago

@webifish thanks for the disclosure :) As WPML just released new versions, may I ask for which version this bug is scheduled to be squashed?

vukvukovich commented 8 years ago

It could be in next major one.

senlin commented 8 years ago

It could be in next major one.

I'm sorry, but that really is a super vague answer. You'd better say "I have no idea if it will ever be addressed; don't count on it", so we can move on...

vukvukovich commented 8 years ago

Sorry, but I cannot give you precise answer at the moment. It will be definitely fixed. I will update here as soon as I have more precise information.

senlin commented 8 years ago

ok thanks @vukvukovich

ghost commented 8 years ago

This patch works with Domain per language setting. In aq_resizer-1x.php add following lines at the beginning of sf_aq_resize function.

/* WPML Fix for Image issue in Different domain per language */
if ( defined( 'ICL_SITEPRESS_VERSION' )){
global $sitepress;
$url = $sitepress->convert_url($url,$sitepress->get_default_language());
}
/* WPML Fix for Image issue in Different domain per language */
ghost commented 8 years ago

@syamilmj Can you please confirm, if the code works for you, If yes, can you please add it in aq_resizer-1x.php file, So its compatible with WPML.

As we got the client back, after updating the theme, which has resizer plugin installed, The new updates didn't work, May be the code is not added yet.

alessandroalessio commented 3 years ago

Add my personal 50 cents to notify this bugifx not working if the website use WPML but not in "domain mode". I've added a row to completely solve my problem:

/* WPML Fix */ $wpml_icl_settings = get_option('icl_sitepress_settings'); if ( defined( 'ICL_SITEPRESS_VERSION' ) && $wpml_icl_settings['language_negotiation_type']==2 ){ global $sitepress; $url = $sitepress->convert_url( $url, $sitepress->get_default_language() ); var_dump($url); } /* WPML Fix */