Keyword

K2, JoomFish and the "Fatal error"

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 9 months ago - 12 years 9 months ago #62342 by Saulius
K2, JoomFish and the "Fatal error" was created by Saulius
Hello, everyone @k2 community,

to be honest I'm not that new to K2 itself - I have already build three sites with K2 integrated in the content. All of them work fine. However, I faced this problem the other night while trying to make K2 work with Joomfish. Had some problems with JoomFish not seeing K2 realted stuff but managed to sort that out after reading this post here: community.getk2.org/forum/topics/joomfish-and-k2-how-do-they I did exactly as Olivier Nolbert suggested:

Hi,
If you've installed JoomFish after K2, and don't want to make a full K2 update, just unzip the K2 zip install file in local and copy/upload all files under "/administrator/components/com_joomfish/contentelements" in the same directory on your website.
Olivier

After doing that I'm able to see and translate all things related to K2 (inc. K2 extra fileds, K2 categories, etc.) except K2 Items. That's a problem coz that's what I need to translate... After going to components/Joom!Fish/Translation in joomla admin and choosing the language and (Content elements) K2 Items from the drop-down menu I get the following error Fatal error: Call to undefined method translationFilter::translationFilter() in /home/angrupe/domains/iseta.lt/public_html/administrator/components/com_joomfish/contentelements/translationK2_categoryFilter.php on line 18. None of that happens when I choose for example K2 Categories from the same drop-down menus. Here's how the above mention php file looks like:

<?php
/**
* @version $Id: translationK2_categoryFilter.php 1034 2011-10-04 17:00:00Z joomlaworks $
* @package K2
* @author JoomlaWorks www.joomlaworks.gr
* @copyright Copyright (c) 2006 - 2010 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: www.gnu.org/copyleft/gpl.html
*/

// Don't allow direct linking
defined( 'JPATH_BASE' ) or die( 'Direct Access to this location is not allowed.' );

class translationK2_categoryFilter extends translationFilter {
function translationK2_categoryFilter($contentElement) {
$this->filterNullValue = -1;
$this->filterType = "catid";
$this->filterField = $contentElement->getFilter("K2_category");
parent::translationFilter($contentElement);
}

function _createFilter() {
$database = &JFactory::getDBO();
if (!$this->filterField)
return "";
$filter = "";
if ($this->filter_value != $this->filterNullValue) {
$sql = "SELECT tab.id FROM #__k2_items as tab WHERE tab.catid=$this->filter_value";
$database->setQuery($sql);
$ids = $database->loadObjectList();
$idstring = "";
foreach ($ids as $pid) {
if (strlen($idstring) > 0)
$idstring .= ",";
$idstring .= $pid->id;
}
$filter = "c.id IN($idstring)";
}
return $filter;
}

function _createfilterHTML() {
if (!$this->filterField)
return "";
$db = &JFactory::getDBO();
$categoryOptions = array();
$categoryOptions[] = JHTML::_('select.option', '-1', JText::_('K2_SELECT_CATEGORY'));

$sql = "SELECT DISTINCT p.id, p.name FROM #__k2_categories as p, #__".$this->tableName." as c WHERE c.".$this->filterField."=p.id ORDER BY p.name";
$db->setQuery($sql);
$cats = $db->loadObjectList();
$catcount = 0;
foreach ($cats as $cat) {
$categoryOptions[] = JHTML::_('select.option', $cat->id, $cat->name);
$catcount++;
}
$catnameList = array();
$catnameList["title"] = JText::_('K2_CATEGORIES');
$catnameList["html"] = JHTML::_('select.genericlist', $categoryOptions, 'catid_filter_value', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $this->filter_value);
return $catnameList;
}
}
?>

Line number 18 I think is function translationK2_categoryFilter($contentElement)


What could be the problem...?
I would really appreciate your help!

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

More
12 years 9 months ago #62343 by Daniil
Replied by Daniil on topic Re: K2, JoomFish and the "Fatal error"
Please help

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

  • Antonio Bruno Barros Azevedo
  • Antonio Bruno Barros Azevedo's Avatar
  • Offline
  • New Member
More
12 years 9 months ago #62344 by Antonio Bruno Barros Azevedo
Replied by Antonio Bruno Barros Azevedo on topic Re: K2, JoomFish and the "Fatal error"
Hi,

You need to open the k2_items.xml and change:


<translationfilters>
<K2_category>catid</K2_category>
(...)

to

<translationfilters>
<K2_categories>catid</K2_categories>
(...)

Solved.

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

  • Saulius
  • Saulius's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 8 months ago #62345 by Saulius
Replied by Saulius on topic Re: K2, JoomFish and the "Fatal error"
Thanks, Bruno! That really solved the problem!
Sorry for my late reply, though ;)

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

More
11 years 7 months ago #62346 by krmr
Replied by krmr on topic Re: K2, JoomFish and the "Fatal error"
It's unbelievable that this post is a year old, and I still have to go and hack that file in K2 v.2.6.5! Or am I doing something wrong?

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


Powered by Kunena Forum