boldenamsterdam / htmlcache

Cache pages to HTML and boost website performance on Craft CMS 3
MIT License
31 stars 21 forks source link

SQLSTATE[42S02]: Base table or view not found #7

Closed uksitebuilder closed 5 years ago

uksitebuilder commented 5 years ago

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cpu_htmlcache_caches' doesn't exist The SQL being executed was: DELETE FROM cpu_htmlcache_caches

After checking the database, I found the table: cpu_htmlcachecachescpu

So, it looks like it is adding the DB table prefix after the table name as well.

uksitebuilder commented 5 years ago

In addition, i renamed the table mentioned above correctly, which now allows me to save the Settings, but when visiting the front-end of the site, I get the following error:

The table does not exist: {{%htmlcache_elements}}

After further investigation seems the migrations/install.php file contains erroneous '%' at the end of various table names and field names, etc

Hope you get this fixed for the latest version of Craft 3

bragle commented 5 years ago

Why don't you make a pull request? 😺

boldenamsterdam commented 5 years ago

@uksitebuilder I see the problem. I adjusted the code in dev-master. Can you check if that fixes the problem?

uksitebuilder commented 5 years ago

I think there still may be a problem on line 46: %sites% and line 58: %htmlcache_elements%

boldenamsterdam commented 5 years ago

@uksitebuilder I pushed a new release with the migration fix. It should work now

uksitebuilder commented 5 years ago

Took a bit to get it installed.

Installed via the admin CP, but installation failed. However on refreshing the plugin was installed.

Had to manually create the directory -> storage/runtime/htmlcache

Seems to be working as expected now though.

Using latest v3.0.28 of Craft