fb-instant-articles icon indicating copy to clipboard operation
fb-instant-articles copied to clipboard

A nested twitter embed in a post causes a fatal error when loading reader facing urls.

Open benbreedlove opened this issue 6 years ago • 3 comments

Steps required to reproduce the problem

  1. With wordpress version 5.2.1 and Instant Articles for WP version 4.2.0
  2. Create a post with a twitter embed wrapped within a twitter embed blockquote, like so
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Ferger Place Historic District<a href="https://t.co/atGXcNFbxU">https://t.co/atGXcNFbxU</a> <a href="https://t.co/iATarwphXn">pic.twitter.com/iATarwphXn</a></p>&mdash; Wiki Titles Singable to TMNT Themesong (@wiki_tmnt) <a href="https://twitter.com/wiki_tmnt/status/1140665423291023360?ref_src=twsrc%5Etfw">June 17, 2019</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></blockquote>
  1. Save the post
  2. Go to page where one would expect the post to display for readers.

Expected Result

Creation of fbia code fails in isolation.

Actual Result

Post permalink fails to load with a 500 error. Archive/homepage urls containing the post fail to load with a 500 error. Stack trace looks like

Stack trace:
#0 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Getters/MultipleElementsGetter.php(34): Facebook\InstantArticles\Transformer\Transformer::cloneNode(NULL)
#1 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/ConfigurationSelectorRule.php(160): Facebook\InstantArticles\Transformer\Getters\MultipleElementsGetter->get(Object(DOMElement))
#2 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/InteractiveRule.php(82): Facebook\InstantArticles\Transformer\Rules\ConfigurationSelectorRule->getProperty('interactive.ifr...', Object(DOMElement))
#3 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php(338): Facebook\InstantArticles\Transformer\Rules\InteractiveRule->apply(Object(Facebook\InstantArticles\Transformer\Transformer), Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMElement))
#4 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PassThroughRule.php(32): Facebook\InstantArticles\Transformer\Transformer->transform(Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMElement))
#5 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php(338): Facebook\InstantArticles\Transformer\Rules\PassThroughRule->apply(Object(Facebook\InstantArticles\Transformer\Transformer), Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMElement))
#6 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Rules/PassThroughRule.php(32): Facebook\InstantArticles\Transformer\Transformer->transform(Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMElement))
#7 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php(338): Facebook\InstantArticles\Transformer\Rules\PassThroughRule->apply(Object(Facebook\InstantArticles\Transformer\Transformer), Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMElement))
#8 /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php(265): Facebook\InstantArticles\Transformer\Transformer->transform(Object(Facebook\InstantArticles\Elements\InstantArticle), Object(DOMDocument))
#9 /var/www/wp-content/plugins/fb-instant-articles/class-instant-articles-post.php(686): Facebook\InstantArticles\Transformer\Transformer->transformString(Object(Facebook\InstantArticles\Elements\InstantArticle), '<p>Meghan McCai...', 'UTF-8')
#10 /var/www/wp-content/plugins/fb-instant-articles/class-instant-articles-post.php(873): Instant_Articles_Post->to_instant_article()
#11 /var/www/wp-content/plugins/fb-instant-articles/class-instant-articles-post.php(950): Instant_Articles_Post->is_empty_after_transformation()
#12 /var/www/wp-content/plugins/fb-instant-articles/facebook-instant-articles.php(352): Instant_Articles_Post->should_submit_post()
#13 /var/www/wp-includes/class-wp-hook.php(286): inject_ia_markup_meta_tag('')
#14 /var/www/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#15 /var/www/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
#16 /var/www/wp-includes/general-template.php(2745): do_action('wp_head')
#17 /var/www/wp-content/themes/motherjones/header.php(63): wp_head()
#18 /var/www/wp-includes/template.php(722): require_once('/var/www/wp-con...')
#19 /var/www/wp-includes/template.php(671): load_template('/var/www/wp-con...', true)
#20 /var/www/wp-includes/general-template.php(41): locate_template(Array, true)
#21 /var/www/wp-content/themes/motherjones/singular.php(18): get_header()
#22 /var/www/wp-includes/template-loader.php(78): include('/var/www/wp-con...')
#23 /var/www/wp-blog-header.php(19): require_once('/var/www/wp-inc...')
#24 /var/www/index.php(17): require('/var/www/wp-blo...')
#25 {main}
  thrown in /var/www/wp-content/plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Transformer/Transformer.php on line 105 [www.motherjones.com/politics/2019/06/meghan-mccain-asked-twitter-for-fathers-day-dad-stories-thousands-of-people-replied/] []

Version Info

  • Plugin version: 4.2.
  • WordPress version: 5.2.1
  • PHP version: 7.3

benbreedlove avatar Jun 17 '19 20:06 benbreedlove

Related: https://github.com/Automattic/facebook-instant-articles-wp/pull/814

ethanclevenger91 avatar May 28 '20 16:05 ethanclevenger91

Facing the same issue here. Does Anybody found any way to solve without touch plugin code ?

rbacarin avatar Aug 10 '20 13:08 rbacarin

@benbreedlove @rbacarin any chance you also had custom transformer rules configured?

ethanclevenger91 avatar Oct 16 '20 19:10 ethanclevenger91

This issue has been marked stale because it has been open for 30 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

github-actions[bot] avatar Oct 05 '22 00:10 github-actions[bot]