1. Paul Adamson
  2. Bug report
  3. Wednesday, 26 July 2017
  4.  Subscribe via email
Hi, just something I observed while working with the component for the first time. I created a custom field list for hotspots and noticed the field was not being rendered for some hotspots, maybe about 30% of them. I traced it down to the fact that I had created a zero-based list index, and for any hotspot that had the first item in the list selected, the field was not rendered. That's because in the file views/hotspot/tmpl/default.php (and its layout override), this line is used to test the field value:


<?php if ($this->hotspot->customfields && $this->customFields) : ?>
<div class="hotspots-customfields">
<?php foreach ($this->hotspot->customfields as $key => $customFields): ?>
<?php if (isset($this->customFields[$key])) : ?>
<?php if ($customFields): ?> // <----------- RIGHT HERE
<dl class="dl-horizontal">
<dt><?php echo JText::_($this->customFields[$key]->title); ?></dt>
<dd><?php echo CompojoomFormCustom::render($this->customFields[$key], $customFields); ?></dd>
</dl>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>


With a zero-based index, the field is never rendered. I worked around it by reindexing my select values.

Is there a reason that we don't test for isset($customFields) instead of just $customFields evaluating true?

Cheers
Paul
Responses (0)


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

Link to maps.google.de in default.php
Hi, i have a question about the default.php under hotspot. i want to integrate...
1 Replies
Posted on Sunday, 19 May 2024
  • New
  • Veranstaltung im Frontend sichtbar obwohl nicht ve
    Hallo, folgendes Problem stellt sich mir: Wenn ich eine Veranstaltung dupl...
    4 Replies
    Posted on Friday, 09 February 2024
    Suche bei der Matukio - Fehler Ö Ä Ü..
    Hallo, evtl. könnt ihr mir weiterhelfen. Bei mir funktioniert die suche bei ...
    3 Replies
    Posted on Wednesday, 15 May 2024
  • New
  • When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    4 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5
    _MATUKIO_NO_EVENTS appears in the frontend if no e
    Hello, there ist still the problem, that on the frontpage appears COM_MATUKIO...
    2 Replies
    Posted on Sunday, 12 May 2024
  • New