- Posts: 1
COMMUNITY FORUM
JModel vs K2Model - fatal error
- Vio Stepanov
-
Topic Author
- Offline
- New Member
k2 updated to version 2.6.0, and immediately there was an error -
Fatal error: Cannot make static method JModel::addIncludePath() non static in class K2Model in /home/pxxxxx/www/mysite.com/administrator/components/com_k2/models/model.php on line 40
in the backend, we can not act, constantly displays the indicated error, my site is dead, what to do? Help!
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- coen
-
- Offline
- New Member
- Posts: 5
We cannot do anything!
Please help in how to reach our backoffice again
What can we do?
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- coen
-
- Offline
- New Member
- Posts: 5
Thanks in advance!
Please Log in or Create an account to join the conversation.
- Gregwh
-
- Offline
- Senior Member
- Posts: 57
Lefteris Kavadas wrote: Hi. K2 only supports Joomla! 1.5, 2.5 and 3.0. Other versions of Joomla! are not supported in K2. 2.6. You should update Joomla! to 2.5 or go back to K2 2.5.7.
The error I get as soon as I logon to the backend is:
"Model Class cpanelModelCpanel not found in file"
....which is odd. I dont use cPanel to administer the backend of my K2 site. This error has ONLY occurred ever since I updated to the latest K2. I had updated to the latest Joomla, version 2.5.7, the week before K2 was updated.
While this error doesnt stop me administering in the backend in K2 or even in Joomla, it is a definite worry.
To the person who cannot get to the backend of their site any longer, you might contact your site hosting agent. I host my own stuff as a reseller through Hostgator. They keep automatic updates and can revert your site to an earlier version if needed. Your hosting agent may be able to do the same for you.
Please Log in or Create an account to join the conversation.
- Gregwh
-
- Offline
- Senior Member
- Posts: 57
Lefteris Kavadas wrote: The release announcement states clearly that K2 2.6 is only compatible with Joomla! 1.5, 2.5 and 3.0 only. Try to go back to K2 2.5.7. If you have no admin access place the package contentns using FTP.
PS,
There was no announcement about compatibility when I updated. There was only the notice on the Joomla panel that there was an update to be had. You click on it and it says K2 and that is that. There was no notice at all.
I am using Joomla 2.5.7.
Please Log in or Create an account to join the conversation.
- coen
-
- Offline
- New Member
- Posts: 5
Where can I find K2 2.5.7? Do I just need to exchange the files in the component directory?
thnx
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- coen
-
- Offline
- New Member
- Posts: 5
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
There are several ways but unfortuanetlly non of them is very easy. You can extract the package in your computer and then look at the files. You need to replace the 2.6. files with the files of 2.5.7 package. You are going to need FTP access to your server for this. An important thing to remember is that the plugins files need their own directory. This means for example that the file of the 2.5.7 package /plugins/system/k2.php needs to be placed at /plugins/system/k2/k2.php. Before you place the files make sure to backup in case you delete any wrong files. After finishing you will probably be able to access your administration. If so install the K2 2.5.7 again through the installer.
UPDATE: Another possible solution would probably be to just remove (or rename) the file /plugins/system/k2/k2.php. I have not tested yet but this should give you admin access again so you can install the K2 2.5.7.
Please Log in or Create an account to join the conversation.
- coen
-
- Offline
- New Member
- Posts: 5
Ευχαριστώ!
Please Log in or Create an account to join the conversation.
- AdrianK
-
- Offline
- Senior Member
- Posts: 46
administrator/components/com_k2/models/model.php ?
than you can change a line and get back to the backend
else if (version_compare(JVERSION, '2.5', 'ge'))
to
else if (version_compare(JVERSION, '2.5', 'le'))
update joomla
and alter this line back to
else if (version_compare(JVERSION, '2.5', 'ge'))
Please Log in or Create an account to join the conversation.
- mc
-
- Offline
- New Member
Hi Lefteris Kavadas,Lefteris Kavadas wrote: NOTE - This is only for Joomla! 1.6. and 1.7 users who accidentally installed K2 2.6
There are several ways but unfortuanetlly non of them is very easy. You can extract the package in your computer and then look at the files. You need to replace the 2.6. files with the files of 2.5.7 package. You are going to need FTP access to your server for this. An important thing to remember is that the plugins files need their own directory. This means for example that the file of the 2.5.7 package /plugins/system/k2.php needs to be placed at /plugins/system/k2/k2.php. Before you place the files make sure to backup in case you delete any wrong files. After finishing you will probably be able to access your administration. If so install the K2 2.5.7 again through the installer.
Thank you for this solution. This helped to restore me website.
If I may make a simple suggestion... on your download page, there is just one download option. with the text "DOWNLOAD K2 for Joomla! 1.5, 2.5 & 3.0, v2.6.3 (GNU/GPL) / Released January 30th, 2013"
Most extensions for 1.5 work in 1.7, so if there is an alternate package for Joomla 1.6/1/7, why not have a second download option displayed for those users running Joomla 1.6/1/7?
So then on your K2 Doownload page, you would have:
"DOWNLOAD K2 for Joomla! 1.5, 2.5 & 3.0, v2.6.3 (GNU/GPL) / Released January 30th, 2013"
"DOWNLOAD K2 for Joomla! 1.6 & 1.7, v2.5.7 (GNU/GPL) / Released January 30th, 2011"
Just a helpful suggestion.
Thanks again for your help
Please Log in or Create an account to join the conversation.
- Alexey Yaksuhin
-
- Offline
- New Member
- Posts: 1
I have Joomla 2.5.18 + K2 2.5.7 + JoomSEF 4.5.1 + PHP 5.2.17
When i try to update K2 even to 2.6.0-2.6.7 - I have same error.
PHP Fatal error: Cannot make static method JModel::addIncludePath() non static in class K2Model in /home/****/*****/www/administrator/components/com_k2/models/model.php on line 0
And site go down compleatly (and back end too). Only rename of plugins/system/k2/k2.php allow me go to backend.
BUT, if i use PHP 5.3.6-13 on another hosting - than no problem, everything works fine.
So is it possible get problem only in PHP version? Or it something else?
Because
Joomla 2.5.18 + K2 2.6.7 + PHP 5.2.17 = working
Joomla 2.5.18 + K2 2.6.7 + JoomSEF 4.5.1 + PHP 5.3.6 = working
Joomla 2.5.18 + K2 2.6.7 + JoomSEF 4.5.1 + PHP 5.2.17 = site completely down
Any ideas?
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
You should not get this error in K2 2.6.7. The JModel::addIncludePath() is static in Joomla! 2.5 and is also declared static in K2Model. So, something else is wrong:
1. K2 is not updating properly. Ensure that your server permissions are fine and that you can install/update extensions without problem.
2. Maybe JoomSEF is overriding some core Joomla! classes and is causing all this.
Probably it is number 2 since the same setup works without JoomSEF.
Please Log in or Create an account to join the conversation.