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

Complete Uninstall to Work in J4??
We have recently updated a site from Joomlav3 to v4 (4.4.2). Now when we go to m...
4 Replies
Posted on Tuesday, 30 April 2024
  • New
  • verschiedene URL's für Kursübersicht einer Kategor
    Hallo, ich habe eine Frage in Bezug auf SEO: ein externer Spezialist macht die...
    1 Replies
    Posted on Monday, 29 April 2024
  • New
  • Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    1 Replies
    Posted on Wednesday, 24 April 2024
    Changes to Submission Form?
    Are you able to make changes to the Hotspot submission form? There are several f...
    0 Replies
    Posted on Friday, 26 April 2024
    Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
    • #custom fields