Last Updated on Monday, 11 June 2012
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. My client had 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 this repair table command to match the database table where your K2 articles are stored (eg. "zu1fq_k2_items").
Latest Posts
-
Joes Revolver Map (JRM)
-
Fri 17-May-13
Hmmm... Sounds like a problem with the identifier. Was it working before and has there been a change ...
-
Fri 17-May-13
Hello Joel: Yes, I do have it published on all pages of the site. I just went back to Revolver maps to ...
-
Fri 17-May-13
Hi Bill, From the developers of RevolverMaps, "the module would need to be published on every page ...
-
Fri 17-May-13
Hi Bill, I'll investigate further as you're not the first to say this happens. In the meantime, simply ...
-
Fri 17-May-13
Its a great extension. But when I set it up I only show my presence on the 3D map and no other visitors ...
-
Fri 17-May-13


Comments
I recreated this error by overloading a Joomla! CMS website with extensions that I've installed and uninstalled. Basically a lot of third party extensions (especially modules) do not have uninstall scripts, so my database had more tables that were no longer used than ones I was actually using.
I think basically, it's too much for your server to handle in terms of having to read a huge database file so housekeeping is key.
I thought I didn't have much installed when it happened to my site; but both my K2 and Remository (=download manager extension) had crashed. And that was only with about 100 downloads of a Joomla! module I had written. Everything that you install will each send several queries to your servers and the database, too many in fact.
Overloading the server was my issue. This isn't saying that this is what caused your error or that K2 are excess code. All I can do is say what happened to me and what fixed it. There are reports that it keeps happening to people but I'm lucky so far.
Glad this got your K2 articles back :c) Happy to help.
Thaks again.
Thanks man, this post saved my site.
God bless you!
Seriously, I appreciate your time to post the resolution. Bless you!
the SQL says msg_text is OK
i can't figure out what wrong?
Please help me~
If you can send me a link or screenshot I can check for you but msg_text does not necessarily indicate a problem with your K2 setup. From memory, this is a joomla variable but I'll wait to hear from you before suggesting anything.
Kind Regards,
Joe
Thanks thanks many thanks!
Bests
RSS feed for comments to this post