-
AuthorPosts
-
troponin Friend
troponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
October 26, 2011 at 7:08 pm #170084Hey,
I use the new Joomla k2 v2.5 with Joomla 1.7.2 and T3 Framework for 1.7.
With the new K2 User Module you have the Option to render a Menu. In this Menu you can add a K2 Edit Link which will open from k2_user_module modal and from the Menu Link in pop-up.
Now I have noticed that I get a white screen on both. This Issue only happen if I use T3. I know that most of your templates use K2 Support. So could you plz take a look at this issue ?
Snippet from K2 Module Template :
[PHP]<ul class=”k2UserBlockRenderedMenu”>
<?php $level = 1; foreach($menu as $key => $link): $level++; ?>
<li class=”linkItemId<?php echo $link->id; ?>”>
<?php if($link->type==’url’ && $link->browserNav==0): ?>
<a href=”<?php echo $link->route; ?>”><?php echo $link->name; ?></a>
<?php elseif(strpos($link->link,’option=com_k2&view=item&layout=itemform’) || $link->browserNav==2): ?>
<a class=”modal” rel=”{handler:’iframe’,size:{x:990,y:550}}” href=”<?php echo $link->route; ?>”><?php echo $link->name; ?></a>
<?php else: ?>
<a href=”<?php echo $link->route; ?>”<?php if($link->browserNav==1) echo ‘ target=”_blank”‘; ?>><?php echo $link->name; ?></a>
<?php endif; ?><?php if(isset($menu[$key+1]) && $menu[$key]->level < $menu[$key+1]->level): ?>
<ul>
<?php endif; ?><?php if(isset($menu[$key+1]) && $menu[$key]->level > $menu[$key+1]->level): ?>
<?php echo str_repeat(‘</li></ul>’, $menu[$key]->level – $menu[$key+1]->level); ?>
<?php endif; ?><?php if(isset($menu[$key+1]) && $menu[$key]->level == $menu[$key+1]->level): ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>[/PHP]and this is the helper.php
[PHP]<?php
/**
* @version $Id: helper.php 1160 2011-10-13 16:23:58Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.gr
* @copyright Copyright (c) 2006 – 2011 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined(‘_JEXEC’) or die(‘Restricted access’);JLoader::register(‘K2HelperRoute’, JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’route.php’);
JLoader::register(‘K2HelperUtilities’, JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’utilities.php’);class modK2UserHelper {
function getReturnURL($params, $type) {
if($itemid = $params->get($type))
{
$menu =& JSite::getMenu();
$item = $menu->getItem($itemid);
$url = JRoute::_($item->link.’&Itemid=’.$itemid, false);
}
else
{
// stay on the same page
$uri = JFactory::getURI();
$url = $uri->toString(array(‘path’, ‘query’, ‘fragment’));
}return base64_encode($url);
}function getType() {
$user = & JFactory::getUser();
return (!$user->get(‘guest’)) ? ‘logout’ : ‘login’;
}function getProfile( & $params) {
$user = &JFactory::getUser();
$db = & JFactory::getDBO();
$query = “SELECT * FROM #__k2_users WHERE userID=”.(int)$user->id;
$db->setQuery($query, 0, 1);
$profile = $db->loadObject();if ($profile){
if ($profile->image!=”)
$profile->avatar = JURI::root().’media/k2/users/’.$profile->image;require_once (JPATH_SITE.DS.’components’.DS.’com_k2′.DS.’helpers’.DS.’permissions’.’.php’);
if (JRequest::getCmd(‘option’)!=’com_k2′)
K2HelperPermissions::setPermissions();if(K2HelperPermissions::canAddItem())
$profile->addLink = JRoute::_(‘index.php?option=com_k2&view=item&task=add&tmpl=component’);return $profile;
}
}
function countUserComments( $userID ) {
$db = & JFactory::getDBO();
$query = “SELECT COUNT(*) FROM #__k2_comments WHERE userID=”.(int)$userID.” AND published=1″;
$db->setQuery($query);
$result = $db->loadResult();
return $result;}
function getMenu($params){
$items = array();
if($params->get(‘menu’)) {
$menu = &JSite::getMenu();
$items = $menu->getItems(‘menutype’, $params->get(‘menu’));
}
foreach ( $items as $item ) {
if(K2_JVERSION==’16’){
$item->name = $item->title;
$item->parent = $item->parent_id;
}
$index = $item->parent;
$list = @$children[$index] ? $children[$index] : array();
array_push( $list, $item );
$children[$index] = $list;
}
if(K2_JVERSION==’16’){
$items = JHTML::_(‘menu.treerecurse’, 1, ”, array(), $children, 9999, 0, 0 );
}
else {
$items = JHTML::_(‘menu.treerecurse’, 0, ”, array(), $children, 9999, 0, 0 );
}
$links = array();
foreach($items as $item) {
if($item->type == ‘url’) {
$item->route = $item->link;
}
if(K2_JVERSION == ’15’) {
$item->level = $item->sublevel;
}
$links[] = $item;
}
return $links;
}
}
[/PHP]In the Source Code of the blank screen I get :
Fatal error: Call to undefined method K2ModelItem::getUserProfile() in /var/www/l3s2186/html/…/components/com_k2/helpers/utilities.php on line 42
thx
October 30, 2011 at 6:44 pm #422448I too havuing an issue with this module and T3, except rather than get a blank screen I get a Not Found error as for some reason T3 alters the url.
I have confirmed the functionality works as expected using a built in 1.7.2 theme beez.
troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
October 31, 2011 at 11:34 am #422568The Reported Issue was solved, but the Problem still happen.
Joomlaworks reported : Obviously this is a T3 Framework issue. K2 uses the Joomla! framework to auto load some classes. Probably T3 breaks that.
It would be nice if a Developer of Joomlart would take a look. In K2 Version 2.5.1 and JAT3 2.0 the Issue happen if u use the Mod_K2_User and use the Render Menu Function. By clicking the link a blank Screen would be shown.
In Developer Mode of Firefox I can see this code :
<div id=”k2ModuleBox85″ class=”k2UserBlock”>
<div class=”k2UserBlockDetails”>
<a class=”k2Avatar ubAvatar” href=”/dsad/itemlist/user/42-superuser” title=”My page”>
<img src=”
Fatal error: Call to undefined method K2ModelItem::getUserProfile() in /var/www/…/html/…/components/com_k2/helpers/utilities.php on line 44troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
October 31, 2011 at 3:33 pm #422608Reply from Lefteris @ Joomlaworks Bug Report :
After looking at the code it seems that T3 tries to render the modules but it shouldn’t. K2 sets the variable tmpl=component in it’s controller in editing tasks. This variable, traditionally forces Joomla! to render only the component without the modules. When tmpl=component is set in the URL T3 behaves as it should. When the variable is not in the URL but it is set via the Joomla! API then T3 seems to ignore it and tries to load modules. The code in K2 that sets that variable can be found at /components/com_k2/controllers/item.php, at line 64. The code reads:
JRequest::setVar(‘tmpl’, ‘component’);
Unfortunately T3 seems to ignore it. You are kindly requested to post this issue on T3 support forums.
Arvind Chauhan ModeratorArvind Chauhan
- Join date:
- September 2014
- Posts:
- 3835
- Downloads:
- 74
- Uploads:
- 92
- Thanks:
- 1240
- Thanked:
- 1334 times in 848 posts
November 1, 2011 at 12:48 pm #422779Issue passed to devs to check. please give some time to check and get back.
Arvind
troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
November 1, 2011 at 1:19 pm #422784<em>@drarvindc 280226 wrote:</em><blockquote>Issue passed to devs to check. please give some time to check and get back.</blockquote>
Thanks for the Information.
troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
November 3, 2011 at 10:13 am #423047Hi troponin
You open file templates/<ja_template>/component.php and add this block code
if (class_exists('T3Template')) {
$tmpl = T3Template::getInstance();
$tmpl->loadLayout();
}
before line
include (dirname(__FILE__).DS.'index.php');
Refresh your page.
troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
November 4, 2011 at 5:30 am #423177any news to this ?
troponin Friendtroponin
- Join date:
- March 2007
- Posts:
- 21
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 4
- Thanked:
- 2 times in 1 posts
November 9, 2011 at 9:12 am #423782December 8, 2011 at 1:59 pm #428711Is there any update to this topic from the devs?
I have added the above code but for some insane reason when the Mega Menu alters the link to my new article page. If I use a non T3 template such as the Beez20 the link to the new article function works correctly so therefore T3 must be doing something to the link.
The menu creates ok, but the link http://arranhospice.org/site/new/index2.php/members-area/new-article gets me a 4040 Not Found error, if I change index2.php to index.php it works as expected so something is going awry.
Any help appreciated.
November 15, 2012 at 9:11 am #472993Years later, same issue.
j!2.5.8, Mendozite Template, T3 2.5.6
If it doesn’t work properly with K2, that’s a serious limitation of T3 … any hope it’s going to be fixed?
Anyone reading this at all? -
AuthorPosts
This topic contains 11 replies, has 4 voices, and was last updated by wdburgdorf 11 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum