Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPML + Image resize issues #1625

Closed
Kwapi opened this issue Jan 4, 2018 · 2 comments
Closed

WPML + Image resize issues #1625

Kwapi opened this issue Jan 4, 2018 · 2 comments

Comments

@Kwapi
Copy link

Kwapi commented Jan 4, 2018

Timber 1.5.2, Wordpress 4.9, PHP 5.6

Using the latest version of WPML on a translated page the resized images' urls have a trailing language query string i.e /?lang=fr.
This causes the images not to display and output the following error:

notice: 
Undefined index: extension in /app/wp-content/plugins/timber-library/lib/ImageHelper.php on line 386
Call Stack:    0.0013     239376   
1. {main}() /app/index.php:0    0.0013     239800   
2. require('/app/wp-blog-header.php') /app/index.php:17    1.3295   13947168   
3. require_once('/app/wp-includes/template-loader.php') /app/wp-blog-header.php:19    1.3515   13900384   
4. include('/app/wp-content/themes/made_ioc/page.php') /app/wp-includes/template-loader.php:74    2.5708   15274152   
5. Timber\Timber::render() /app/wp-content/themes/made_ioc/page.php:137    2.5708   15274296

(...)

I'm resizing the images using the resize filter in a Twig template.

@Kwapi
Copy link
Author

Kwapi commented Jan 4, 2018

Managed to fix it by replacing home_url() with site_url() at line 171 of URLHelper.php.
@jarednova Perhaps you could fix that in the new version? I'm happy to create a pull request.

This seems to be a similar issue to this

@jarednova
Copy link
Member

@Kwapi Yes, please submit a PR to this please! Tracking down when to use home_url vs site_url has been a continual piece of work. I'd love to get this one resovled

jarednova added a commit that referenced this issue Jan 22, 2018
jarednova pushed a commit that referenced this issue Mar 5, 2018
jarednova pushed a commit that referenced this issue Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants