Its still on localhost Standard Docker PHP 7.3 stack which I’ve used on previous Bedrock + Sage projects.
In fact I copied over my dockerfile + related files into this new project, but grabbed latest Bedrock + Sage… enabled the theme and there there error was…
I ran composer create-project roots/sage a couple days ago, and yet it installed 9.0.9 instead of 9.0.10?
in any event, no when I remove that public static function title() function, the error remains… doesn’t seem to have to do with anything relating to that…
Btw. for Sage 9 there is an update branch in progress that fixes a lot of problems, notably with the webpack build:
As you are working in a development environment, could you either debug (e.g. VSCode breakpoint with XDebug or just a good old var_dump(...); exit; this particular line (1200) in the WordPress core code of the site ((web/)wp/wp-includes/general-template.php in Bedrock sites)? https://github.com/WordPress/WordPress/blob/5.6.2/wp-includes/general-template.php#L1200
What are the values of $paged and $page? Are these integers, strings or arrays?
Any plugins enabled?
@strarsis FYI when using the provided command for 9.2, i get:
composer create-project roots/sage foobar-test dev-webpack5 --repository='{"type":"vcs","url":"https://github.com/strarsis/sage"}'
Creating a "roots/sage" project at "./mobile-guardian"
GitHub API limit (0 calls/hr) is exhausted, could not fetch https://api.github.com/repos/strarsis/sage/contents/composer.json?ref=7e8f3ae346409f9f6eae68a32c4a75b818b9cbe4. Create a GitHub OAuth token to go over the API rate limit. You can also wait until ? for the rate limit to reset.`
Ah right, you should set up a GitHub access token for your tools. This is a good idea anyway as it doesn’t cost anything and lifts the existing GitHub API quotes to normal user levels.
So the string is Page Array. This is quite a good indication that the page number (it should probably be Page 1 for example instead) is actually an array, which it shouldn’t be or at least further processed by a filter into something that can be cast to a string (what WordPress core expects). Can you also debug/print the page number related variables (as linked above in the WP core code)?
@MWDelaney FYI, thanks to @strarsis’s help with debugging this, installing Yoast SEO fixed the problem… I assume the default way that WP returns the title as an array which Yoast or similar knows how to handle, but Sage doesn’t?
I’m no expert, but just thought I’d share in case it helps identify a bug somewhere
Whilst I have you, would you mind checking that screenshot I posted about the controller not sending data to the template view? Am I doing something stupid there?
Yes this was my scenario… IE my brand new, out the box install, had this issue. I confirmed it was the theme, by switching to one of the default themes.