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

Undefined variable notices in inc/class-tachyon.php on line 363 #47

Open
peterwilsoncc opened this issue Dec 21, 2019 · 4 comments
Open

Comments

@peterwilsoncc
Copy link
Contributor

peterwilsoncc commented Dec 21, 2019

I'm receiving a lot of undefined variables notices when using WP 5.3.2 with Tachyon, it caused by the compact( ... 'size' ) variable in the tachyon_post_image_args hook.

[21-Dec-2019 10:47:54 UTC] PHP Notice:  compact(): Undefined variable: size in /chassis/vendor/humanmade/tachyon-plugin/inc/class-tachyon.php on line 363
[21-Dec-2019 10:47:54 UTC] PHP Stack trace:
[21-Dec-2019 10:47:54 UTC] PHP   1. {main}() /chassis/index.php:0
[21-Dec-2019 10:47:54 UTC] PHP   2. require() /chassis/index.php:19
[21-Dec-2019 10:47:54 UTC] PHP   3. require_once() /chassis/wordpress/wp-blog-header.php:19
[21-Dec-2019 10:47:54 UTC] PHP   4. include() /chassis/wordpress/wp-includes/template-loader.php:98
[21-Dec-2019 10:47:54 UTC] PHP   5. get_template_part() /chassis/content/themes/koji/singular.php:11
[21-Dec-2019 10:47:54 UTC] PHP   6. locate_template() /chassis/wordpress/wp-includes/general-template.php:168
[21-Dec-2019 10:47:54 UTC] PHP   7. load_template() /chassis/wordpress/wp-includes/template.php:671
[21-Dec-2019 10:47:54 UTC] PHP   8. require() /chassis/wordpress/wp-includes/template.php:724
[21-Dec-2019 10:47:54 UTC] PHP   9. the_content() /chassis/content/themes/koji/content.php:23
[21-Dec-2019 10:47:54 UTC] PHP  10. apply_filters() /chassis/wordpress/wp-includes/post-template.php:253
[21-Dec-2019 10:47:54 UTC] PHP  11. WP_Hook->apply_filters() /chassis/wordpress/wp-includes/plugin.php:206
[21-Dec-2019 10:47:54 UTC] PHP  12. Tachyon::filter_the_content() /chassis/wordpress/wp-includes/class-wp-hook.php:288
[21-Dec-2019 10:47:54 UTC] PHP  13. compact() /chassis/vendor/humanmade/tachyon-plugin/inc/class-tachyon.php:363

The site in question is using smart media from Altis/media 2.x if that is likely to be having an effect.

@peterwilsoncc
Copy link
Contributor Author

Night brain has been most helpful...

It looks like the cause here is $size remains undefined for full size images. This is the case for both images scaled and unscaled images in WordPress 5.3.

This was tested using the highly technical process of adding var_dump( $attachment_id, isset( $size ) ? $size : '! isset' ); above the tachyon_post_image_args hook.

I'll chuck a PR up in the next couple of weeks, if you set up a travis ci config (I didn't think to give myself write access to this repo) I'll throw in some unit tests.

@roborourke
Copy link
Contributor

I think we need to handle full size more better in general, just hit another snag with gaussholder compat for full size images. Will do a PR to address these problems.

@peterwilsoncc
Copy link
Contributor Author

Thanks Rob, sorry for the lack of promised PR. I figured out my night brain was almost correct in the message above but didn't provide complete information.

@roborourke
Copy link
Contributor

Hmm, thinking about it now did you fix this in #50 ?

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