Sage 9 upgrade to Beta4 - Not loading SoberWP controllers

Working on a Sage 9 theme. Was at commit right after adding SoberWP controller (8172de691f49bce8f3719b09844cfde149de1d75). Things were working well.

Did a comparison with the current master branch and carefully updated files (assuming it would be helpful to stay current). When I try to go to a page on the dev site now, I get an error saying class “App” is not found. It’s referenced by {!! App::title() !!} in resources\views\partials\page-header.blade.php. However that class is defined in the App.php controller (in resources\controllers) so should work (like it was).

I played around and checked the Hierarchy Debugger. The first reference is to ‘controllers/app.php’, which is the same as it was before, so seems like that wouldn’t be the problem.

Did some research and in the old version Sober\Controller\Loader was being called during the ‘init’ hook and loading the controllers. But in the new version, as far as I can tell it doesn’t seem like Sober\Controller\Loader is being called.

Any ideas on what could be causing the problem? I’m a bit stuck on next steps for troubleshooting. Thanks.

@patram1121 just want to quickly confirm that you are using Controller as a Composer dep to Sage and not as a plugin?

1 Like

Yes. From compser file:

"soberwp/controller": "dev-master"

Was able to troubleshoot. Thanks to @withjacoby for the help. Two takeaways:

  1. Controllers in Sage9 now look at app/controllers by default. Looks like they updated the documentation and moved the folder today.

  2. I only finally got things working when I made a copy of the theme and then activated the copy. Going forward if I’m doing updates to be safe seems I guess I’ll deactivate the current theme, make the updates, and then activate. If anyone knows why and can shed some light on why this would need to be done, I’m curious to know.

1 Like

I think it could be a cache issue, editing the blade file clears the cache, I wonder if that could be it? Either that or Composer was caching dev-master of Controller, which has now been tagged with 9.0.0-beta.4 to avoid such issues.