Skip to content

Issue with @published and @modified when trying format the date for a given post #57

@gmutschler

Description

@gmutschler

When trying to format a date for a specific post (so outside the loop) with say @published('c', $my_post_id), I got the following error :

ErrorException thrown with message "is_int() expects exactly 1 argument, 2 given (View: /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/resources/views/<partial-or-component-name>.blade.php) (View: /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/resources/views/<partial-or-component-name>.blade.php)"

Stacktrace:
#26 ErrorException in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/storage/framework/views/5c73c21d2feb906cdb575e6a6a17a888e1f9d60c.php:18
#25 Illuminate\View\Engines\CompilerEngine:handleViewException in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/PhpEngine.php:60
#24 ErrorException in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/storage/framework/views/5c73c21d2feb906cdb575e6a6a17a888e1f9d60c.php:18
#23 Illuminate\View\Engines\CompilerEngine:handleViewException in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/PhpEngine.php:60
#22 ArgumentCountError in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/storage/framework/views/5c73c21d2feb906cdb575e6a6a17a888e1f9d60c.php:18
#21 is_int in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/storage/framework/views/5c73c21d2feb906cdb575e6a6a17a888e1f9d60c.php:18
#20 require in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/filesystem/Filesystem.php:107
#19 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/filesystem/Filesystem.php:108
#18 Illuminate\Filesystem\Filesystem:getRequire in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/PhpEngine.php:58
#17 Illuminate\View\Engines\PhpEngine:evaluatePath in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/CompilerEngine.php:61
#16 Illuminate\View\Engines\CompilerEngine:get in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:139
#15 Illuminate\View\View:getContents in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:122
#14 Illuminate\View\View:renderContents in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:91
#13 Illuminate\View\View:render in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Concerns/ManagesComponents.php:92
#12 Illuminate\View\Factory:renderComponent in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/storage/framework/views/d401be0f5ff0cd450673ff34520d64b8693aac18.php:36
#11 require in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/filesystem/Filesystem.php:107
#10 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/filesystem/Filesystem.php:108
#9 Illuminate\Filesystem\Filesystem:getRequire in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/PhpEngine.php:58
#8 Illuminate\View\Engines\PhpEngine:evaluatePath in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/Engines/CompilerEngine.php:61
#7 Illuminate\View\Engines\CompilerEngine:get in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:139
#6 Illuminate\View\View:getContents in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:122
#5 Illuminate\View\View:renderContents in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/vendor/illuminate/view/View.php:91
#4 Illuminate\View\View:render in /<path-to-bedrock-project>/web/app/themes/<sage-theme-name>/index.php:15
#3 include in /<path-to-bedrock-project>/web/wp/wp-includes/template-loader.php:106
#2 require_once in /<path-to-bedrock-project>/web/wp/wp-blog-header.php:19
#1 require in /<path-to-bedrock-project>/web/index.php:6
#0 require in /<path-to-home>/.composer/vendor/laravel/valet/server.php:214

Same with @modified directive, but it seems to work in cases, I don't need to provide an ID (eg: @published('c')).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions