Basically you've woken up this morning, visited your website, and all your K2 articles are gone !!!!
If you login to your Joomla! administration panel (back-end) and look under k2 items, you should get the following error:
copyraw
Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80
- Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80
If I went to K2 Comments, I'd get an additional error:
copyraw
Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80 Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/comments/tmpl/default.php on line 145
- Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80
- Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/comments/tmpl/default.php on line 145
So I checked these pages and the error is at a foreach() line where it's pulling data from the database. I asked to see the jos_k2_items table and it returned the following error:
copyraw
#145 - Table './jos_k2_items' is marked as crashed and should be repaired
- #145 - Table './jos_k2_items' is marked as crashed and should be repaired
The Quick Fix
I managed to fix this with this SQL command . Note: you need to be able to run SQL commands against your database. My client had phpMyAdmin installed so I click on "jos_k2_items" table and then click on the "SQL" tab
Type the following query:
Note that I say "jos_k2_items" because by default that's what it is... If you changed the table prefix when you installed Joomla! on your site (default is "jos_") then you'll need to change this repair table command to match the database table where your K2 articles are stored (eg. "zu1fq_k2_items").
Category: Joomla :: Article: 277
Add comment