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

Post-social.php syntax error #1884

Closed
rlambertsen opened this issue Mar 23, 2021 · 1 comment
Closed

Post-social.php syntax error #1884

rlambertsen opened this issue Mar 23, 2021 · 1 comment
Assignees
Labels
Estimate: < 2 Hours priority: high Either blocks work on a priority-normal task or a solution here informs other work. status: in progress type: bug

Comments

@rlambertsen
Copy link
Collaborator

rlambertsen commented Mar 23, 2021

Using Wordpress 5.7
PHP 8.0.3
Largo 0.6.4

When I installed the theme for doc rewrite I came across this issue.

Opening any post would throw this error

Fatal error: Uncaught ValueError: Unknown format specifier "D" in /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/inc/post-social.php:113 Stack trace: #0 /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/inc/post-social.php(113): sprintf('<span data-serv...', 'Email', 'bob%20the%20bui...', 'hey%20im%20bob%...', 'https%3A%2F%2Fl...') #1 /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/partials/content-single.php(22): largo_post_social_links() #2 /Users/rylan/Desktop/sites/largo/wp-includes/template.php(732): require('/Users/rylan/De...') #3 /Users/rylan/Desktop/sites/largo/wp-includes/template.php(676): load_template('/Users/rylan/De...', false, Array) #4 /Users/rylan/Desktop/sites/largo/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #5 /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/single-one-column.php(26): get_template_part('partials/conten...', 'single') #6 /Users/rylan/Desktop/sites/largo/wp-includes/template.php(732): require('/Users/rylan/De...') #7 /Users/rylan/Desktop/sites/largo/wp-includes/template.php(676): load_template('/Users/rylan/De...', false, Array) #8 /Users/rylan/Desktop/sites/largo/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #9 /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/single.php(8): get_template_part('single-one-colu...') #10 /Users/rylan/Desktop/sites/largo/wp-includes/template-loader.php(106): include('/Users/rylan/De...') #11 /Users/rylan/Desktop/sites/largo/wp-blog-header.php(19): require_once('/Users/rylan/De...') #12 /Users/rylan/Desktop/sites/largo/index.php(17): require('/Users/rylan/De...') #13 /Users/rylan/.composer/vendor/laravel/valet/server.php(219): require('/Users/rylan/De...') #14 {main} thrown in /Users/rylan/Desktop/sites/largo/wp-content/themes/largo/inc/post-social.php on line 113

This looks to come from the social share buttons.

largo/inc/post-social.php

Lines 108 to 114 in fb65806

$output .= sprintf(
'<span data-service="email" class="email share-button"><a href="mailto:?subject=%2$s&body=%3$s%0D%0A%4$s" rel="noopener noreferrer" target="_blank"><i class="icon-mail"></i> <span class="hidden-phone">%1$s</span></a></span>',
esc_attr( __( 'Email', 'largo' ) ),
rawurlencode( html_entity_decode( get_the_title(), ENT_QUOTES, get_option( 'blog_charset' ) ) ), // subject
rawurlencode( html_entity_decode( strip_tags( get_the_excerpt() ), ENT_QUOTES, get_option( 'blog_charset' ) ) ), // description
rawurlencode( html_entity_decode( get_the_permalink() ) ) // url
);

@rlambertsen
Copy link
Collaborator Author

closing as this PR fixes this issue #1886

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Estimate: < 2 Hours priority: high Either blocks work on a priority-normal task or a solution here informs other work. status: in progress type: bug
Projects
None yet
Development

No branches or pull requests

2 participants