Thursday, May 17, 2012

K2 Items disappear

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:

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:

 

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:
 
#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.  I have phpMyAdmin installed so I click on "jos_k2_items" table and then click on the SQL tab
 
Type the following query:
REPAIR TABLE jos_k2_items

 

 

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 my repair table command to match the database table where your K2 articles are stored.

Add comment

Please note: all comments are reviewed before being published.


Security code
Refresh

Member Login

Joes Latest Members

A huge WELCOME goes to today's newest members:

  • infonat
Member Signups (Activated)
BeforeCurrentTrend
Day21=
Week105ê
Month11224ê
Year2,265612ê

Member Stats
58 guests are currently online.
1,178 members are still deciding.
There are 5,935 members in total.

Latest Comments

Paypal Donations

Want to support my work? Any donation is a blessing :c)