Keyword

K2 2.4.1 Item parameter type harcoded object it

  • Willie
  • Willie's Avatar Topic Author
  • Offline
  • New Member
More
13 years 4 months ago #96471 by Willie
I thik I've found a bug on version 2.4.1 for custom parameter type element.

 

From the code, it would allow to use parameters of type "item" to a K2 plugin, so that we can associate an item to user field, for example.

 

But it seems the item.php ignores the object parameter, needed to receive the result from the selection of the items list popup.

 

Down to code:

 

file administrator/components/com_k2/views/items/tmpl/element.php, around line 54 looks like

 

<td><a class="k2ListItemDisabled" title="<?php echo JText::_('Click to add this item'); ?>" onclick="window.parent.jSelectItem('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->title); ?>', id')"><?php echo $row->title; ?></a></td>

 

While it should look like:

 

<td><a class="k2ListItemDisabled" title="<?php echo JText::_('Click to add this item'); ?>" onclick="window.parent.jSelectItem('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->title); ?>', '<?php echo JRequest::getVar('object','id');?>')"><?php echo $row->title; ?></a></td>
 

Best regards,

Willie

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


Powered by Kunena Forum