K2 items/category error

GK User
Wed Nov 20, 2013 9:39 pm
My k2 has been working and all of a sudden l am getting this error when l click on K2 --> item or K2 --> Catgeories

An error has occurred.
0 SQL=SELECT i.*, g.title AS groupname, c.name AS category, v.name AS author, w.name as moderator, u.name AS editor FROM hsm_k2_items as i LEFT JOIN hsm_k2_categories AS c ON c.id = i.catid LEFT JOIN hsm_viewlevels AS g ON g.id = i.access LEFT JOIN hsm_users AS u ON u.id = i.checked_out LEFT JOIN hsm_users AS v ON v.id = i.created_by LEFT JOIN hsm_users AS w ON w.id = i.modified_by WHERE i.trash=0 ORDER BY i.id DESC LIMIT 0, 20

Also, the website keeps refreshing with this error on the homepage...

Can anyone help me?

Thanks
User avatar
Senior Boarder

GK User
Thu Nov 21, 2013 10:12 am
Please try to disable News Show Pro modules one by one - probably one of them is trying to display not existing item.
User avatar
Platinum Boarder

GK User
Thu Nov 21, 2013 11:41 am
I have disabled it and this is what l see on the homepage:
Warning
JFile: :read: Unable to open file: /home/mysite/public_html/components/com_k2/js/k2.js?v2.6.7&sitepath=/

and this is what l see when l click K2 --> items

An error has occurred.
0 SQL=SELECT COUNT(*) FROM hsm_k2_items WHERE catid=1 AND trash = 0

Any help?

Thanks
User avatar
Senior Boarder

GK User
Thu Nov 21, 2013 11:52 am
I also searched on K2 Forum

and someone had the same issue below:

-----------

Previously, I could remove (unset) "k2.js" from the header as below:

unset($this->_scripts[$this->baseurl .'/components/com_k2/js/k2.js']);


But now, after upgrading to version 2.6.7, that doesn't work anymore. That's certainly because the js file is called with a new path:

/components/com_k2/js/k2.js?v2.6.7&sitepath=/


So I have two different question:

1. How should I unset the k2.js file? (Probably with preg_match_all)

2. From where the k2.js is declared? I mean, where is the code that add k2.js to the header?

Thanks in advance
-------------------------

and this is what the admin said:
------------------

Hello irmax,

The script is loaded like this:

$document->addScript(JURI::root(true).'/media/k2/assets/js/k2.js?v=2.6.7&sitepath='.JURI::root(true).'/');

You can modify the unset rule to match the loading
------------------------

I do not not Javascript.. How do l do what the admin said above?

Thanks
User avatar
Senior Boarder

GK User
Wed Nov 27, 2013 10:13 am
This issue is strictly related with K2 - the script is not included in template it is core K2 file. Please contact with K2 support with this problem; you can also make a test and change name of template /html directory (for example to /bak_html) and check K2 then. But I suspect this is a kind of bug inside K2.
User avatar
Platinum Boarder

GK User
Wed Nov 27, 2013 7:48 pm
I fixed the issue. Thanks
User avatar
Senior Boarder

GK User
Fri Nov 29, 2013 12:20 pm
Could you tell us where was the problem? Maybe other members have similar problems…
User avatar
Platinum Boarder

GK User
Fri Dec 06, 2013 10:15 pm
Did anyone find the solution to this problem?
User avatar
Fresh Boarder

GK User
Sat Dec 07, 2013 1:55 pm
It looks like it is kind of K2 database problem, did you try to repair databases via phpMyAdmin?
User avatar
Platinum Boarder

GK User
Sat Dec 07, 2013 4:21 pm
I have attempted a repair through the Joomla Backend, WHM and PHPMyAdmin - still no dice.
User avatar
Fresh Boarder

GK User
Mon Dec 09, 2013 9:28 pm
It is mystery issue, @OWSUK resolved problem but don't want to share his solution :) Maybe it is just K2 installation issue, did you try to reinstall this extension?
User avatar
Platinum Boarder

GK User
Tue Aug 18, 2015 4:22 pm
Dear'm almost the same kind of problem!
See the message when saved any article or login ... I make all the front-end
JFile: :read: Unable to open file: /var/www/html/portal/components/com_k2/js/k2.js?v2.6.9&sitepath=/portal/

What is the solution?
User avatar
Junior Boarder

GK User
Tue Aug 18, 2015 4:24 pm
K2.js the file in line 31:
30 // Set the root path site
31 K2SitePath getUrlParams = var ('k2.js', 'sitepath');
User avatar
Junior Boarder

GK User
Wed Aug 19, 2015 6:56 pm
Yes solved!
Template.
Advanced settings
Excluded JS/CSS: com_k2/js/k2.js
Tks
User avatar
Junior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.