Keyword

Error after K2 update

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 13 hours ago #104635 by Sebastian van Greunen
Error after K2 update was created by Sebastian van Greunen
Hi, I have just updated K2 2.6.0 running on joomla 2.5.7. When I click on the k2 item tab in the admin area I get the following error:

Fatal error: Call to a member function categoriesTree() on a non-object in /home/a3rd02/public_html/find-design.co.za/administrator/components/com_k2/views/items/view.html.php on line 124

On the front end I get a 404 error when I try to view any K2 category or item. Is there any solution for this.

Thanks

Please Log in or Create an account to join the conversation.

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • New Member
More
12 years 16 minutes ago #104636 by Sebastian van Greunen
Replied by Sebastian van Greunen on topic Re: Error after K2 update
OK I have updated to version 2.6.1 hoping that the bugs had been resolved, but it is still the same and my entire website is now un-usable. Here is line 124:

$categories = $categoriesModel->categoriesTree(NULL, true, false);

Anyone have any ideas on why this happens on the update. I have also updated the mini k2 module as suggested elsewhere in the forum

Thanks

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #104637 by karlo
Replied by karlo on topic Re: Error after K2 update
Fatal error: Call to a member function categoriesTree() on a non-object in /home/public_html/sites/test/administrator/components/com_k2/views/items/view.html.php on line 124

Hi

I have the same problem. The problem appears on the site which I K2mart. On other sites without K2mart problem is gone.

Please Log in or Create an account to join the conversation.

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • New Member
More
11 years 11 months ago #104638 by Sebastian van Greunen
Replied by Sebastian van Greunen on topic Re: Error after K2 update
Thanks, you are right I just removed K2mart and now I can access the items in the admin area. The problem I still have is when trying to view the item on the frontend. Every item gives a 404 Not Found
The server can not find the requested page:. I am in the process of moving my domains to a new host, but I am not sure if this has anything to do with it?

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #104639 by Lefteris
Replied by Lefteris on topic Re: Error after K2 update
@Sebastian van Greunen

If you are using K2 multiple images plugin then probably that is causing your issue. There is another thread on this forum regarding this issue. Just update the plugin to it's latest stable version.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago - 11 years 11 months ago #104640 by Nico Eshuis
Replied by Nico Eshuis on topic Re: Error after K2 update
I'm not using k2 multiple images and I have exact the same problem.

I'm also using k2mart.

I've used var_dump to check out the categoriesModel and it seems that the system can't find the K2ModelCategories class:


$categoriesModel = K2Model::getInstance('Categories', 'K2Model');

But it is present in the file:

/administrator/components/com_k2/models/categories.php

What causes this error?

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago - 11 years 11 months ago #104641 by Darren Janeczek
Replied by Darren Janeczek on topic Re: Error after K2 update
This problem occurs in a lot of places since the update, for a lot of models.

Here is some debug output that I produced from the find (path, file) function:

Path fail trying to find |extrafield.php| ... in: Array (
[0] => Joomla\components\com_k2\models
[1] => Joomla\components\com_k2\models )

(It's looking in the same place twice, which is interesting)

The model php file that I'm looking for exists in administrator/components, but not in the front end site components folder structure.

--edited--

I've added the 'administrator' model location to the include path.

to line 17 of Joomla/administrator/components/com_k2/models/item.php, add
JModel::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models', 'K2Model');

$ git diff Joomla/administrator/components/com_k2/models/item.php
diff --git a/Joomla/administrator/components/com_k2/models/item.php b/Joomla/administrator/components/com_k2/models/item.php
index 068f283..64afb2c 100644
--- a/Joomla/administrator/components/com_k2/models/item.php
+++ b/Joomla/administrator/components/com_k2/models/item.php
@@ -14,6 +14,9 @@ jimport('joomla.application.component.model');

JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');

+JModel::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models', 'K2Model');^M
+
+
class K2ModelItem extends K2Model
{

getk2.org/community/New-to-K2-Ask-here-first/163385-Error-after-K2-update#163924

Please Log in or Create an account to join the conversation.

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
11 years 11 months ago #104642 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Error after K2 update
If you're using K2Mart, see this solution here

K2 Rocks \m/

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum