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

Google map styles migrating......
Google are updating their map styles. Is there anything we need to do to migrate...
0 Replies
Posted on Monday, 18 March 2024
  • New
    • #google maps
    • #map styles
    Latest Hotspots Makes Website Hang
    When using the Latest Hotspot module, the webpage slows down and does not load....
    3 Replies
    Posted on Monday, 15 January 2024
    Text ändern
    Hallo in der Übersicht der Veranstaltungen kann man ja auf "Mehr Informati...
    0 Replies
    Posted on Thursday, 14 March 2024
  • New
  • When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    3 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5
    No margin between text and map
    Hi, I'd like a margin between the small map and the text. Do you have a sugge...
    4 Replies
    Posted on Friday, 02 February 2024