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

[K4] Error in stats.php with page IDs consisting only of numbers #46

Open
sciloqi opened this issue Feb 7, 2024 · 1 comment
Open

Comments

@sciloqi
Copy link

sciloqi commented Feb 7, 2024

I get the message "Kirby\Cms\App::page(): Argument #1 ($id) must be of type ?string, int given, called in /.../site/plugins/simplestats/src/models/Stats.php on line 938" in backend.

I have some page IDs with numbers only (e.g. "360"), so PHP seems to treat $uid as int in this case. I was able to work around by making sure that $uid is string ($uid = strval($uid); before line 938). The diagram creation process now works as expected.

I'm running Kirby 4.1.0 on PHP 8.2.15, so I don't know if it's a case for the Kirby 4 incompatibility list or just a PHP issue.

Anyway, thanks for this great plugin!

@sciloqi sciloqi changed the title Error in stats.php with page IDs consisting only of numbers [K4] Error in stats.php with page IDs consisting only of numbers Feb 7, 2024
@Daandelange
Copy link
Owner

Hey,
Thanks for the detailed bug report, sounds legit, I'll apply your solution somewhen soon.

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