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

Paginate error in DynamicMeta #196

Closed
joshuabaker opened this issue Aug 11, 2018 · 1 comment
Closed

Paginate error in DynamicMeta #196

joshuabaker opened this issue Aug 11, 2018 · 1 comment

Comments

@joshuabaker
Copy link

PHP is throwing a type error in DynamicMeta.

Argument 1 passed to craft\web\twig\variables\Paginate::getPageUrl()
must be of the type integer, null given, called in
/project/vendor/nystudio107/craft-seomatic/src/helpers/DynamicMeta.php on line 59

Adjusting the condition to check currentPage is set seems to rectify the issue. Perhaps it should be the totalPages instead?

if ($pageInfo !== null && $pageInfo->currentPage) {

For context, there’s zero results on the page where I’m seeing this. The page info object getting passed to that method below, for reference.

craft\web\twig\variables\Paginate#1
(
    [first] => null
    [last] => null
    [total] => 0
    [currentPage] => null
    [totalPages] => 0
)
@khalwat
Copy link
Collaborator

khalwat commented Aug 11, 2018

Fixed in a8185fd

@khalwat khalwat closed this as completed Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants