COMMUNITY FORUM
K2, JoomFish and the "Fatal error"
- Saulius
- Topic Author
- Offline
- Junior Member
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:
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: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
Line number 18 I think is function translationK2_categoryFilter($contentElement)<?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;
}
}
?>
What could be the problem...?
I would really appreciate your help!
Please Log in or Create an account to join the conversation.
- Daniil
- Offline
- New Member
- Posts: 1
Please Log in or Create an account to join the conversation.
- Antonio Bruno Barros Azevedo
- Offline
- New Member
- Posts: 1
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
- Topic Author
- Offline
- Junior Member
Sorry for my late reply, though ;)
Please Log in or Create an account to join the conversation.
- krmr
- Offline
- Senior Member
- Posts: 61
Please Log in or Create an account to join the conversation.