Can't hide News pro GK4 - K2 helper Route error

Responsive Joomla template for Entertainment and Music purpose with clean and lightweight design.
GK User
Wed Jan 04, 2012 4:27 am
Hi,

When i try to hide News pro GK4 in home page.
i am getting following error,

Fatal error: Class 'K2HelperRoute' not found in /home/eastpac/public_html/modules/mod_image_show_gk4/styles/gk_music/model.php on line 105

appreciate anyone could help me.

Regards,
Dilip
User avatar
Fresh Boarder

GK User
Wed Jan 04, 2012 11:44 am
Hi,

Try downloading and reinstalling K2 component, I think the current one in your site is corrupted.
User avatar
Platinum Boarder

GK User
Sun Jan 08, 2012 2:18 pm
I downloaded this template now in Jan, but it still gives me the same problem - crashing my site when i hide Latest News? Surely it cannot be K2? Any updates yet? I think I am running 2.5.2 though?

Any ideas anyone?

rgds,
Phehello
User avatar
Fresh Boarder

GK User
Thu Jan 12, 2012 8:40 am
I don´t think it can be K2 that is the problem. I get the same error with k2 ver 2.5.1 and the error is still there after upgrading k2 to ver. 2.5.4.

modules\mod_image_show_gk4\styles\gk_music\model.php on line 105

So any ideas?

Kind regards
User avatar
Senior Boarder

Konrad M
Thu Jan 12, 2012 9:07 am
Hi
Try install last NSP GK4 update and override files.
User avatar

GK User
Mon Jan 16, 2012 1:28 pm
Hi,
Updated as you suggested - but it don´t work either.

This line gives the error: //'link' => urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->cid.':'.urlencode($item->cat_alias)))), in the model.php
Kind regards
User avatar
Senior Boarder

GK User
Mon Jan 16, 2012 5:54 pm
I have the same problem on the home page of my site as well. Just a further thing I've noticed in playing around with it is:

With no module published to the mainbody position on the home page and the News Show Pro module unpublished, I get the following error:

Fatal error: Class 'K2HelperRoute' not found in /.../public_html/gallery/modules/mod_image_show_gk4/styles/gk_music/model.php on line 105

However, if I publish a custom module to the mainbody position (with News Show Pro still unpublished), I get a blank screen when viewing the home page.

I went through and updated K2 and News Show Pro as well so have the latest versions installed.
User avatar
Fresh Boarder

GK User
Tue Jan 17, 2012 1:09 pm
Anyone having this issue just PM your FTP access then I will debug to fix for you!
User avatar
Platinum Boarder

GK User
Wed Jan 18, 2012 7:59 am
Hi,
I have tested a little bit more. I think it has nothing to do with NSP, but if i unpublish K2 tabs/comments in right_bottom on the frontpage it gives the error. Likewise, if i unpublish the module K2 comment it gives the error.
Tabs GK4 perhaps?
Kind regards
User avatar
Senior Boarder

GK User
Thu Jan 19, 2012 4:53 pm
tonyz1 wrote:I have the same problem on the home page of my site as well. Just a further thing I've noticed in playing around with it is:

With no module published to the mainbody position on the home page and the News Show Pro module unpublished, I get the following error:

Fatal error: Class 'K2HelperRoute' not found in /.../public_html/gallery/modules/mod_image_show_gk4/styles/gk_music/model.php on line 105

However, if I publish a custom module to the mainbody position (with News Show Pro still unpublished), I get a blank screen when viewing the home page.

I went through and updated K2 and News Show Pro as well so have the latest versions installed.


I have tried to debug for awhile but it is happening too weird and I still don't have any clues on the cause of issue. Can you try reinstalling the module?
User avatar
Platinum Boarder

GK User
Thu Jan 19, 2012 8:53 pm
Don Lee wrote:
tonyz1 wrote:I have the same problem on the home page of my site as well. Just a further thing I've noticed in playing around with it is:

With no module published to the mainbody position on the home page and the News Show Pro module unpublished, I get the following error:

Fatal error: Class 'K2HelperRoute' not found in /.../public_html/gallery/modules/mod_image_show_gk4/styles/gk_music/model.php on line 105

However, if I publish a custom module to the mainbody position (with News Show Pro still unpublished), I get a blank screen when viewing the home page.

I went through and updated K2 and News Show Pro as well so have the latest versions installed.


I have tried to debug for awhile but it is happening too weird and I still don't have any clues on the cause of issue. Can you try reinstalling the module?


Do you mean reinstall News Show Pro GK 4? I reinstalled it a few days ago right before I originally posted so I am running the most recent version.

I tried experimenting a bit more with this today and found that if I have the NSP module published to the home page but set it show Joomla articles instead of K2 articles, the home page disappears. So to summarize, it seems that the only way the Home Page appears properly is if NSP is published to the Home page and is set to show K2 articles.

Really hoping someone can help with this as I don't want to be forced to show this module on the home page.
User avatar
Fresh Boarder

GK User
Fri Jan 20, 2012 7:24 am
@tonyz1,

It is really really WEIRD, I'm stuck right now! Passing this on to a developer to check further for you, I think he can help you better because he develops this module. Please allow us some more time!

Thanks,
User avatar
Platinum Boarder

GK User
Fri Jan 20, 2012 10:04 am
I've checked your configuration and everything look correct, joomla error log is also clean. I've checked the server log but looks like this is not collect errors so they are store in another place. Please contact with your service provide and ask about error log, if you get this please contact with me via PM.
User avatar
Platinum Boarder

GK User
Mon Jan 23, 2012 7:52 pm
bkrztuk wrote:I've checked your configuration and everything look correct, joomla error log is also clean. I've checked the server log but looks like this is not collect errors so they are store in another place. Please contact with your service provide and ask about error log, if you get this please contact with me via PM.


I have more information for you regarding this problem. I reinstalled the quick start package today in another directory (same domain name) and then started unpublishing modules one at a time until I got the error. Here's what I found:

After unpublishing every NSP module on the site, the home page was still there - ie no error. I then started unpublishing Tabs GK4 modules. The error occurs as soon as I unpublish the module "Tabs" which is published to the right-bottom position on the Home page - the tabs are K2Comments and K2Tags.

I then republished Tabs but started modifying it - I unpublished the K2 Tags tab - no error. Unpublished the K2 Comments tab and that's when you get the error.

Without K2 Comments published in the Your Tabs section, there's no home page content and the error reads:
Fatal error: Class 'K2HelperRoute' not found in .../modules/mod_image_show_gk4/styles/gk_music/model.php on line 105

So I then went back to my own development site, republished the Tabs module (which includes K2 Comments) on the Home Page, unpublished the NSP module and the Home Page does show up.

So the problem is definitely related to Tabs GK4 and K2 Comments and not NSP as I originally thought. Although on my development site for whatever reason, if I have NSP published on the Home page, it seems to be okay without the Tabs module published.

If you want to take a look at the quick start package I installed today so you can debug, I will PM you the details.
User avatar
Fresh Boarder

GK User
Tue Jan 24, 2012 1:28 am
It is definitely a problem with the settings arround this TAB module - i have the same problem with the same template right now. When i switch on the module - the front page is OK, if i turn it off - it is giving me the mentioned error. This started after i deleted the K2 articles from the demo. Before that i have this module - TAB switched OFF and all was OK.

Help? :)

BTW forgot to mention - the other pages are OK - the problem is ONLY on the front page.
User avatar
Senior Boarder

GK User
Tue Jan 24, 2012 8:56 am
Hi,
I found the soloution - i think :-)

I took from modules/mod_image_show_gk4/styles/gk_esport/model.php in eSport template from line 67 to line 112 (both included) and replaced the same lines in modules/mod_image_show_gk4/styles/gk_music/model.php in the music template.with these.

As far as i can see, the difference are the line 69 and line 84 - correct me if i am wrong. Now i can unpublish K2 module in right_bottom on the music template :-)

The code from gk_esport are this:

function getDataK2($ids) {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
// prepare an array
$results = array();
// prepare an query part
$query_ids = implode(',', $ids);
// generate the query
$database = JFactory::getDBO();
// SQL query for slides
$query = '
SELECT
`c`.`id` AS `id`,
`c`.`catid` AS `cid`,
`c`.`title` AS `title`,
`c`.`introtext` AS `introtext`,
`c`.alias AS `alias`,
`c`.`publish_up` AS `date`,
`cats`.alias AS `cat_alias`
FROM
#__k2_items AS `c`
LEFT JOIN
#__k2_categories AS `cats`
ON cats.id = `c`.`id`
WHERE
`c`.`id` IN ('.$query_ids.')
;';
// running query
$database->setQuery($query);
// if results exists
if( $datas = $database->loadObjectList() ) {
// parsing data
foreach($datas as $item) {
// array with prepared image
$results[$item->id] = array(
'id' => $item->id,
'cid' => $item->cid,
'title' => stripslashes($item->title),
'date' => $item->date,
'link' => urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->cid.':'.urlencode($item->cat_alias))))
);
}
}
// return the results
return $results;
}
User avatar
Senior Boarder

GK User
Tue Jan 24, 2012 3:49 pm
florint wrote:Hi,
I found the soloution - i think :-)

I took from modules/mod_image_show_gk4/styles/gk_esport/model.php in eSport template from line 67 to line 112 (both included) and replaced the same lines in modules/mod_image_show_gk4/styles/gk_music/model.php in the music template.with these.

As far as i can see, the difference are the line 69 and line 84 - correct me if i am wrong. Now i can unpublish K2 module in right_bottom on the music template :-)

The code from gk_esport are this:

function getDataK2($ids) {
//
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
// prepare an array
$results = array();
// prepare an query part
$query_ids = implode(',', $ids);
// generate the query
$database = JFactory::getDBO();
// SQL query for slides
$query = '
SELECT
`c`.`id` AS `id`,
`c`.`catid` AS `cid`,
`c`.`title` AS `title`,
`c`.`introtext` AS `introtext`,
`c`.alias AS `alias`,
`c`.`publish_up` AS `date`,
`cats`.alias AS `cat_alias`
FROM
#__k2_items AS `c`
LEFT JOIN
#__k2_categories AS `cats`
ON cats.id = `c`.`id`
WHERE
`c`.`id` IN ('.$query_ids.')
;';
// running query
$database->setQuery($query);
// if results exists
if( $datas = $database->loadObjectList() ) {
// parsing data
foreach($datas as $item) {
// array with prepared image
$results[$item->id] = array(
'id' => $item->id,
'cid' => $item->cid,
'title' => stripslashes($item->title),
'date' => $item->date,
'link' => urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->cid.':'.urlencode($item->cat_alias))))
);
}
}
// return the results
return $results;
}


I can confirm that this solution works for me as well. Thanks for sharing!
User avatar
Fresh Boarder

GK User
Thu Jan 26, 2012 9:14 pm
worked for me! and I'm no direct code editor. thanks forum!
User avatar
Fresh Boarder


cron