Strange List View Issue

82 views
Skip to first unread message

Neo314

unread,
Jan 17, 2024, 8:26:26 PMJan 17
to Joomla! General Development
Hi,

I haven't seen much activity in this group for a while. I hope someone might have some idea what this issue is...

I am working on a custom component for festival camping reservations. I have historical data and I have used com_categories to distinguish different festivals (2017 festival, 2018 festival, etc.).

What I am getting is that my get('items') appears to be not advancing to show the last record and instead repeats the second to last record. I've checked the model sql query by dumping it as a string and running it in phpmyadmin, and the query pulls the correct recordset.

Any idea why this might be happening or where to look. Seems like I read about this before but I cannot find any past posting.

Example: if I have records 1,2,3,4,5,6,7,8,9,10, my list view (and $this->items) produces the list 1,2,3,4,5,6,7,8,9,9
If I filter so only items 1 through 4 should appear, instead of getting 1,2,3,4; I get 1,2,3,3.

Glenn Arkell

unread,
Jan 17, 2024, 8:41:13 PMJan 17
to Joomla! General Development
Can you show us the code in the foreach loop of the list display file?

Neo314

unread,
Jan 17, 2024, 9:22:41 PMJan 17
to Joomla! General Development
Sure. Here you go. As I mentioned, I dumped $this->items and the problem is in that dataset, so not this loop, correct?

<?php
$n = count($this->items);
foreach ($this->items as $i => $item) :
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order text-center d-none d-md-table-cell">
<?php
$iconClass = '';
if (!$canChange) {
$iconClass = ' inactive';
} else if (!$saveOrder) {
$iconClass = ' inactive tip-top hasTooltip" title="' . HTMLHelper::_('tooltipText', 'JORDERINGDISABLED');
                }
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order">
<?php endif; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id); ?>
</td>
<td class="text-center">
<?php /* DECIDE WHETHER TO USE
echo HTMLHelper::_('gwrequestsadministrator.featured', $item->featured, $i, $canChange); */ ?>

       <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'gwrequests.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
</td>
<th scope="row" class="has-context">
<?php if ($item->checked_out) : ?>
<?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'gwrequests.', true); ?>
<?php endif; ?>
<div>
<?php //echo $this->escape($item->name); ?><?php echo $this->escape($item->lname); ?>, <?php echo $this->escape($item->fname); ?><br />
<?php echo $this->escape($item->email); ?><br />
<?php //echo $this->escape($item->sortname); ?>
</div>
<?php $editIcon = '<span class="fa fa-pencil-square mr-2" aria-hidden="true"></span>'; ?>
<a class="hasTooltip" href="<?php echo Route::_('index.php?option=com_gwrequests&task=gwrequest.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?> <?php echo $this->escape($item->name); ?>">
<?php echo $editIcon; ?>EDIT RESERVATION</a>
<div class="small">
<?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?>
<?php echo 'From '.$item->event_start.' to '.$item->event_end; ?>
</div>
</th>
<td class="d-none d-md-table-cell">
<?php echo $item->camp_type; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $item->grown_count; ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $item->kid_count; ?>
</td>
<td class="small d-none d-md-table-cell">
<?php echo $item->access_level; ?>
</td>
<?php /* DECIDE WHETHER TO USE
<?php if ($assoc) : ?>
<td class="d-none d-md-table-cell">
<?php if ($item->association) : ?>
<?php echo HTMLHelper::_('gwrequestsadministrator.association', $item->id); ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php if (Multilanguage::isEnabled()) : ?>
<td class="small d-none d-md-table-cell">
<?php echo LayoutHelper::render('joomla.content.language', $item); ?>
</td>
        <?php endif; ?>
        */ ?>

<td class="d-none d-md-table-cell">
<?php echo $item->id; ?>
</td>
</tr>
<?php endforeach; ?>

Glenn Arkell

unread,
Jan 17, 2024, 9:34:27 PMJan 17
to Joomla! General Development
You're absolutely right, sorry, I thought initially it may just be in the foreach loop so it must be in the query with an incorrect join maybe?  But you say you copied the query and ran directly in the database and returned the correct result, yes?  Can you share the model getListQuery() code?

Neo314

unread,
Jan 17, 2024, 9:48:22 PMJan 17
to Joomla! General Development
Here is an update. Even stranger. I copied the default getItem from the ListModel into my model and dumped $this->cache[$store] and it was correct.

So then I dumped $this->items in HtmlView.php and it is correct. But when I dump $this->items at the end of default.php (the view file), it is wrong.

At least I have the search a bot narrowed...

Glenn Arkell

unread,
Jan 17, 2024, 10:06:29 PMJan 17
to Joomla! General Development
Hmm, well I'm at a loss without being able to see the whole and some data, sorry I couldn't help any further.  Cheers.

Neo314

unread,
Jan 17, 2024, 10:35:29 PMJan 17
to Joomla! General Development
Well, I think I found it, but I still do not understand what is happening.

It is a foreach issue and it is in the HtmlView file.

public function display($tpl = null): void
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');

$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new GenericDataException(implode("\n", $errors), 500);
}
var_dump($this->items);
echo "-------------------------------------";

foreach ($this->items as $k => $item) {
$getFields = FieldsHelper::getFields('com_gwrequests.categories', array('id'=>$item->catid), true);
$fields = ArrayHelper::pivot($getFields , 'name');
echo $item->fname." Index=".$k." CatID=".$item->catid." and ID=".$item->id."<br />";
$this->items[$k]->event_start = $fields['event-start']->value;
$this->items[$k]->event_end = $fields['event-end']->value;
}
var_dump($this->items);
echo "-------------------------------------";

This loop retrieves the specific dates of the events and adds those fields to the list view. The dates of the events are custom fields of the categories. I am just not sure why this foreach overwriting the last record with the second to last record. $k should go through every key for every member of the array. As you can see in the output, it doesn't just put the wrong event date into the last item. It, for some reason, overwrights the last item with the second to last item.

I'm sure I'm missing something obvious now...

The output comes out like this...

HtmlView.php:37:
array (size=6)
  0 =>
    object(stdClass)[1082]
      public 'id' => int 1237
      public 'user_id' => int 209
      public 'catid' => int 21
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2023 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
  1 =>
    object(stdClass)[1001]
      public 'id' => int 1203
      public 'user_id' => int 209
      public 'catid' => int 20
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => null
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2022 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
  2 =>
    object(stdClass)[1081]
      public 'id' => int 1070
      public 'user_id' => int 209
      public 'catid' => int 20
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'UNKNOWN' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 195
      public 'checked_out_time' => string '2024-01-03 23:36:02' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2022 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => string 'Steven' (length=6)
  3 =>
    object(stdClass)[1080]
      public 'id' => int 778
      public 'user_id' => int 209
      public 'catid' => int 19
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => null
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2019 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
  4 =>
    object(stdClass)[1079]
      public 'id' => int 502
      public 'user_id' => int 209
      public 'catid' => int 18
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2018 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
  5 =>
    object(stdClass)[1078]
      public 'id' => int 235
      public 'user_id' => int 209
      public 'catid' => int 17
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2017 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null

-------------------------------------

Steven Index=0 CatID=21 and ID=1237
Steven Index=1 CatID=20 and ID=1203
Steven Index=2 CatID=20 and ID=1070
Steven Index=3 CatID=19 and ID=778
Steven Index=4 CatID=18 and ID=502
Steven Index=5 CatID=18 and ID=502

HtmlView.php:54:
array (size=6)
  0 =>
    object(stdClass)[1082]
      public 'id' => int 1237
      public 'user_id' => int 209
      public 'catid' => int 21
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2023 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2023-07-06' (length=10)
      public 'event_end' => string '2023-07-10' (length=10)
  1 =>
    object(stdClass)[1001]
      public 'id' => int 1203
      public 'user_id' => int 209
      public 'catid' => int 20
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => null
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2022 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2022-07-07' (length=10)
      public 'event_end' => string '2022-07-11' (length=10)
  2 =>
    object(stdClass)[1081]
      public 'id' => int 1070
      public 'user_id' => int 209
      public 'catid' => int 20
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'UNKNOWN' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 195
      public 'checked_out_time' => string '2024-01-03 23:36:02' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2022 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => string 'Steven' (length=6)
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2022-07-07' (length=10)
      public 'event_end' => string '2022-07-11' (length=10)
  3 =>
    object(stdClass)[1080]
      public 'id' => int 778
      public 'user_id' => int 209
      public 'catid' => int 19
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => null
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2019 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2019-07-11' (length=10)
      public 'event_end' => string '2019-07-15' (length=10)
  4 =>
    object(stdClass)[1079]
      public 'id' => int 502
      public 'user_id' => int 209
      public 'catid' => int 18
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2018 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2018-07-12' (length=10)
      public 'event_end' => string '2018-07-16' (length=10)
  5 =>
    object(stdClass)[1079]
      public 'id' => int 502
      public 'user_id' => int 209
      public 'catid' => int 18
      public 'camp_type' => string 'Tent Only' (length=9)
      public 'license_plate' => string 'XXXXXX' (length=7)
      public 'grown_count' => int 4
      public 'kid_count' => int 0
      public 'access' => int 2
      public 'checked_out' => int 0
      public 'checked_out_time' => string '0000-00-00 00:00:00' (length=19)
      public 'language' => string '*' (length=1)
      public 'ordering' => int 0
      public 'state' => int 0
      public 'published' => int 0
      public 'publish_up' => null
      public 'publish_down' => null
      public 'name' => string 'Steven' (length=17)
      public 'email' => string 'nob...@nowhere.com' (length=19)
      public 'access_level' => string 'Registered' (length=10)
      public 'category_title' => string '2018 Event' (length=14)
      public 'language_title' => null
      public 'language_image' => null
      public 'fname' => string 'Steven' (length=6)
      public 'lname' => string 'Redacted' (length=10)
      public 'sortname' => string 'Redacted Steven' (length=17)
      public 'editor' => null
      public 'order_up' => boolean true
      public 'order_dn' => boolean true
      public 'event_start' => string '2018-07-12' (length=10)
      public 'event_end' => string '2018-07-16' (length=10)

Glenn Arkell

unread,
Jan 17, 2024, 11:47:22 PMJan 17
to Joomla! General Development
So why are you not including a join of the category record with the base query in the model?  I've never used the FieldsHelper and I certainly wouldn't be "tweeking" the data in the HtmlView field.  Or perhaps even doing the tweeking in the tmpl display file as a last resort.  You said you're using the category to store the festival year - so where are you storing the start and end dates associated with the category (festival year)?  Personally I think you should have a separate reference type database table for the festival year so that you can have some extra reference data which would then be easily accessible via a simple join in the main list query.

Steven Berkson

unread,
Jan 18, 2024, 12:31:04 AMJan 18
to joomla-de...@googlegroups.com
My intention has been to use Categories as a built in feature that served my purpose. The event dates are stored as custom fields (com_fields) for categories associated with the component. 

Your is well taken. Even as I am doing this, I do join the category to the event, so it is a nested query, but I can get the dates into the query as is. A separate table might well be easier.

This still baffles me though. A whole element of the items array is overwritten and I can't see how.

Steven Berkson


From: joomla-de...@googlegroups.com <joomla-de...@googlegroups.com> on behalf of Glenn Arkell <glenn...@gmail.com>
Sent: Wednesday, January 17, 2024 8:47:22 PM
To: Joomla! General Development <joomla-de...@googlegroups.com>
Subject: [jgen] Re: Strange List View Issue
 
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/joomla-dev-general/e5916222-16f4-444f-a23d-2bab061ed545n%40googlegroups.com.

Neo314

unread,
Jan 18, 2024, 1:51:00 AMJan 18
to Joomla! General Development
Thanks for the assistance. I probably should make my own table, but part of my intention was to work with some of the built in features. This may have become more burdensome than my own table, but it is working and I'll look at revamping it later.

I had already solved a similar problem for user custom fields first/last name. I had done this event date thing earlier, so I went back, per your suggestion, and put it in the query instead, but doing so still using categories custom fields. I am sure the overhead is higher than needs be, but this worked and executed quickly. I may come back and change to a separate table.

It never should have been in HtmlView. This is the portion of the model query code. I STILL DON'T UNDERSTAND WHAT WAS HAPPENING IN THE FOREACH LOOP THOUGH. STILL STRIKES ME AS OFF.

                // Get the event start and end dates from categories custom fields
$getFields = FieldsHelper::getFields('com_gwrequests.categories', array());

$fields = ArrayHelper::pivot($getFields , 'name');
$query->select($db->quoteName('c1.value', 'event_start'));
$query->select($db->quoteName('c2.value', 'event_end'))
->join(
'LEFT',
$db->quoteName('#__fields_values', 'c1') . ' ON (' . $fields['event-start']->id . ' = ' . $db->quoteName('c1.field_id'). ') AND (' . $db->quoteName('gwr.catid') . ' = ' . $db->quoteName('c1.item_id'). ')'
)
->join(
'LEFT',
$db->quoteName('#__fields_values', 'c2') . ' ON (' . $fields['event-end']->id . ' = ' . $db->quoteName('c2.field_id'). ') AND (' . $db->quoteName('gwr.catid') . ' = ' . $db->quoteName('c2.item_id'). ')'
);
Reply all
Reply to author
Forward
0 new messages