Fatal error: Class '\Application\Block\Autonav\Controller' not found

Permalink 1 user found helpful
Howdy!

I'm looking for some help troubleshooting a problem that's making my site inaccessible.

All of a sudden I get the following message when I try to access my site's index.php.

An unexpected error occurred. Fatal error: Class '\Application\Block\Autonav\Controller' not found


The console gives me the following info when I try to access any page.

ReferenceError: CCM_DISPATCHER_FILENAME is not defined
c() app.js:3


When I go to index.php/dashboard, I get a completely unstyled dashboard. It looks like the .css is not loading, even though I can access concrete/themes/dashboard/main.css in the browser. At the bottom of the dashboard page it says:

Class '\Application\Block\Autonav\Controller' not found


There's more. When I try to open one of the links from the dashboard page (dashboard/system/environment/debug), I sometimes get this error.

An unexpected error occurred. PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pdo_mysql.so' - /usr/lib/php/20151012/pdo_mysql.so: undefined symbol: mysqlnd_allocator


I'm pretty sure that the problem started happening after I cleared the Cache in the Dashboard. I also worked on including a .less file in my custom theme at the time.

I've gone through a couple of troubleshooting steps already, but none of them solved the problem.

- clearing the browser cache
- removing the autonav and page_list blocks from /application/blocks
- renaming /blocks to /block
- copying the untouched autonav and page_list blocks from /concrete/blocks to /application/blocks
- checked php.ini. "extension=pdo_mysql.so" is active and the file exists. phpinfo(); looks like it's registered the extension.
- reverted to a commit from before I started working on .less
- The theme doesn't have a page_theme.php - do I need one?
- checked another local c5 dev installation; works fine.

Nothing helped. Will try a clean installation next, copying over the theme files and then exporting/importing the sql database.

Has anyone else experienced this problem?

Cheers,

B.

 
publicb replied on at Permalink Reply
Found the error! I feel silly. I should not have copied over the entire folders and contents of the blocks I wanted to modify. Looks like controller.php caused the problem, i.e. not adjusting namespaces after copying these files.

I now copied only view.php and the template files I wanted to modify/override.

The following links helped me better understand the problem.

http://documentation.concrete5.org/developers/working-with-blocks/w...

http://documentation.concrete5.org/developers/working-with-blocks/w...




For the sake of completeness & later reference, here are the steps I've taken to create a clean installation and troubleshoot the problem.

BASIC INSTALLATION
(exported the database of the failed installation earlier, as perhttp://documentation.concrete5.org/developers/installation/moving-a...
- new installation of c5 (as perhttp://documentation.concrete5.org/developers/installation/installa...
- sudo chmod -R 777 application/files/ application/config/ packages/ updates/

MOVING THEME & FILES
- copy theme folder from old site to application/themes in new site
- does Clear Cache work? Yes.
- installing and activating the copied theme: all good
- copy contents of application/files over (everything except /incoming, /cache and index.html)

IMPORT DATABASE
- drop the new db
- recreate the db with same name & user permissions
- import the .sql file exported earlier

BASIC CHECKS
- refreshed page
- Clear Cache: works
- turned off all Caching in the Dashboard: OK
- change some content and publish page: OK


My site was happily working again at this point! Until...


COPYING BLOCKS
- copied entire /autonav and /page_list folders over from /concrete/blocks to application/blocks

Same problem again when I tried to access pages that contain these blocks.

Fatal error: Class '\Application\Block\Autonav\Controller' not found


Fatal error: Class '\Application\Block\PageList\Controller' not found


When I deleted the folders from /application/blocks, the errors went away.
meswaramarco replied on at Permalink Reply
Good post
Gondwana replied on at Permalink Reply
Gondwana
Agree; good post. Possible tip for the future (heaven forfend): instead of dropping the database and recreating it, I've found that it suffices to drop all of the tables. The import still works, and this saves mucking around with user permissions.
publicb replied on at Permalink Reply
cheers guys and thanks for the tip!