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

get_the_excerpt() getting called with null instead of post ID #9

Open
morganestes opened this issue Sep 11, 2017 · 1 comment
Open
Labels
Milestone

Comments

@morganestes
Copy link

When a search results page gets loaded with title and excerpt for each of the results, the debugger throws an error about a deprecated argument. This is caused by Thing::getDescription() passing false as the $post_id, which triggers a call to _deprecated_argument() inside get_the_excerpt(). I'm not sure what part is actually generating the post ID for the arg, but I've included the call stack here to see if someone else can help identify where it's happening.

Best I can tell, it all starts with append_to_footer(), which tries get_the_ID() but that fails and returns false. This just keeps getting passed down the line; even future calls to check it fail because they're using get_the_ID() which has already decided there isn't one to give.

( ! ) Notice: get_the_excerpt was called with an argument that is <strong>deprecated</strong> since version 2.3.0 with no alternative available. in /app/public/wp-includes/functions.php on line 4026
--
1 | 0.0043 | 364256 | {main}( ) | .../index.php:0
2 | 0.1128 | 365424 | require( '/app/public/wp-blog-header.php' ) | .../index.php:17
3 | 0.3119 | 3633768 | require_once( '/app/public/wp-includes/template-loader.php' ) | .../wp-blog-header.php:19
4 | 0.3129 | 3635152 | include( '/app/public/wp-content/themes/connect-base/search.php' ) | .../template-loader.php:74
5 | 0.3296 | 3697424 | get_footer( ??? ) | .../search.php:65
6 | 0.3296 | 3697800 | locate_template( ???, ???, ??? ) | .../general-template.php:84
7 | 0.3296 | 3697880 | load_template( ???, ??? ) | .../template.php:647
8 | 0.3299 | 3698112 | require_once( '/app/public/wp-content/themes/connect-base/footer.php' ) | .../template.php:688
9 | 0.3299 | 3698112 | wp_footer( ) | .../footer.php:9
10 | 0.3299 | 3698112 | do_action( ???, ??? ) | .../general-template.php:2605
11 | 0.3299 | 3698488 | WP_Hook->do_action( ??? ) | .../plugin.php:453
12 | 0.3299 | 3698488 | WP_Hook->apply_filters( ???, ??? ) | .../class-wp-hook.php:323
13 | 0.3299 | 3699616 | Schemify\Theme\append_to_footer( ??? ) | .../class-wp-hook.php:298
14 | 0.3300 | 3699616 | Schemify\Core\get_json( ???, ??? ) | .../theme.php:91
15 | 0.3300 | 3699616 | Schemify\Core\build_object( ???, ??? ) | .../core.php:132
16 | 0.3302 | 3700544 | Schemify\Schemas\Thing->getProperties( ) | .../core.php:46
17 | 0.3302 | 3700544 | Schemify\Schemas\Thing->build( ???, ??? ) | .../Thing.php:98
18 | 0.3302 | 3701936 | Schemify\Schemas\Thing->getProp( ??? ) | .../Thing.php:183
19 | 0.3302 | 3702256 | Schemify\Schemas\Thing->getDescription( ??? ) | .../Thing.php:135
20 | 102.5890 | 3708744 | get_the_excerpt( ??? ) | .../Thing.php:257
21 | 102.5890 | 3708744 | _deprecated_argument( ???, ???, ??? ) | .../post-template.php:376
22 | 102.5891 | 3709064 | trigger_error ( ??? ) | .../functions.php:4026
@stevegrunwell
Copy link
Owner

Hey @morganestes, thanks for the report! Schemify is due for an update, and I'll be sure to look into this!

@stevegrunwell stevegrunwell added this to the Version 1.0.0 milestone Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants