The problem is already fixed for Volkmar and I want to share the solution for those of you that have it. (this is already fixed in the dev. code and it will be part of the next version).
the thing is that jevents has repeating events. The object that holds the information for the particular event has 2 properties -> ev_id and rp_id. rp_id is used when we have repeating events. We didn't take this into an account and our component was always reading the id out of ev_id, but for repeating events the ev_id is the same - where the rp_id is different. first change is in administrator\components\com_comment\plugin\com_jevents\josc_com_jevents.php
function output($row , $params) {
if($row->_ev_id != $row->_rp_id) {
$row->_ev_id = $row->_rp_id;
}
$comObject = JOSC_utils::ComPluginObject('com_jevents',$row);
return JOSC_utils::execJoomlaCommentPlugin($comObject, $row, $params, true);
}
with that code:
if($row->_ev_id != $row->_rp_id) {
$row->_ev_id = $row->_rp_id;
}
we check if we have different rp_id -> this means that we are dealing with a repeating event and we set this as the id of the item that we are interested in.
Next change is in:
administrator\components\com_comment\plugin\com_jevents\josc_com_jevents.class.php
public function getAlias($id) {
$db = JFactory::getDBO();
$query = 'SELECT summary FROM ' . $db->nameQuote('#__jevents_vevdetail') . ' AS vev '
. ' WHERE vev.evdet_id = (
SELECT eventid
FROM ' . $db->nameQuote('#__jevents_repetition')
. ' WHERE rp_id = ' . $db->Quote($id) . ')';
$db->setQuery($query, 0, 1);
return $db->loadObject()->summary;
}
and
function mod_commentsGetOthersQuery($secids, $catids, $maxlines, $orderby) {
$database = JFactory::getDBO();
$limit = $maxlines >= 0 ? " limit $maxlines " : "";
$where = array();
if ($catids)
$where[] = $this->componentCategoryTable . ".id IN ($catids)";
if ($orderby == 'mostrated') {
$mostrated = ", (c.voting_yes-c.voting_no)/2 AS mostrated";
$where[] = "(c.voting_yes > 0 OR c.voting_no > 0)";
} else {
$mostrated = "";
$orderby = "c.$orderby";
}
/*
* TODO: restrict according to user rights, dates and category/secitons published and dates...
*/
$query = "SELECT c.*, rep.eventid, ct." . $this->componentTableFieldTitle . " AS ctitle $mostrated "
. "\n FROM `#__comment` AS c "
. "\n LEFT JOIN " . $database->nameQuote('#__jevents_repetition') . " AS rep ON rep.rp_id = c.contentid "
. "\n LEFT JOIN " . $database->nameQuote($this->componentTable) . " AS ct ON ct.evdet_id = rep.eventid "
. "\n WHERE c.published='1' "
. "\n AND c.component='$this->component' "
. "\n " . (count($where) ? (" AND " . implode(" AND ", $where)) : "")
. "\n ORDER BY $orderby DESC "
. "\n $limit"
;
$database->SetQuery($query);
$rows = $database->loadAssocList();
return $rows;
}
As you can see we go always trough the repetition table to get the proper ev_id for the event. If we don#t have the proper ev_id we cannot produce correct urls.
This is all for now
Cheers,
Daniel