fb-instant-articles
fb-instant-articles copied to clipboard
A nested twitter embed in a post causes a fatal error when loading reader facing urls.
Steps required to reproduce the problem
- With wordpress version 5.2.1 and Instant Articles for WP version 4.2.0
- 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>— 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>
- Save the post
- 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
Related: https://github.com/Automattic/facebook-instant-articles-wp/pull/814
Facing the same issue here. Does Anybody found any way to solve without touch plugin code ?
@benbreedlove @rbacarin any chance you also had custom transformer rules configured?
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.