- This topic has 3 replies, 2 voices, and was last updated 8 years, 5 months ago by
Tom.
-
AuthorPosts
-
November 5, 2017 at 11:40 pm #416874
Enrico
Hello,
in the aq_resizer.php in the GP Pro/blog module, at line 229 there is this part:
if ( defined( 'ICL_SITEPRESS_VERSION' ) ){ global $sitepress; $url = $sitepress->convert_url( $url, $sitepress->get_default_language() ); }Problem: On my site we use wpml with different domains, and if this function runs, it replaces all the attachment sources with the host from the default language. If this happens, I get the
GP_Resize.process() error: Image must be localerror, because the resizer checks on line 103 if the upload url is in the image url:if ( false === strpos( $url, $upload_url ) ) throw new GP_Exception('Image must be local: ' . $url);In my case, the best would be if GP would not convert the url at all, because the images can just as well be served through the language domain. I changed the url convertion part like this:
if ( defined( 'ICL_SITEPRESS_VERSION' ) ){ global $sitepress; $wpml_negotiation_type = apply_filters('wpml_setting',false, 'language_negotiation_type' ) ; if ( $wpml_negotiation_type != 2) { $url = $sitepress->convert_url( $url, $sitepress->get_default_language() ); } }That means I check if wpml is run on different domains for different languages (negotiation type is 2) and only convert only if not.
1) I am not sure why this conversion takes place to begin with. Maybe there is something special about my site, but I don’t understand this step.
2) If this is somehow necessary for other (normal?) setups, what would be the right approach to overwrite this function, so my fix does not get patched away in the future?Thanks for your help
November 6, 2017 at 8:52 am #417186Tom
Lead DeveloperLead DeveloperHi there,
aq_resizer has been completely replaced in GPP 1.5. You can try out the latest beta version here: https://generatepress.com/gp-premium-1-5-alphabeta/
Let me know if it fixes the issue 🙂
November 9, 2017 at 10:41 pm #420336Enrico
Hi,
just installed the new update (1.51) and the issue of not showing the featured post images with wpml on different domains is gone. Worked right out of the box after the update.Thanks
November 9, 2017 at 10:43 pm #420337Tom
Lead DeveloperLead DeveloperGreat news – thanks for letting me know 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.