Implode():[function.implode] error on Form Display

momentis 23 Jan, 2015
I am building a form using the following Custom Code action:

<?php
$date = date('Ymd000000');
$db = JFactory::getDBO();
$query = "
  SELECT
    `events`.`event_id`,
    `events`.`event_published`,
    `events`.`event_datetime`,
    `events`.`event_subtitle`,
    `events`.`event_description`,
    `events`.`event_venue`,
    `events`.`event_band`,
    `venues`.`venue_id`,
    `venues`.`venue_name`,
    `venues`.`venue_street`,
    `venues`.`venue_city`,
    `venues`.`venue_state`,
    `venues`.`venue_zip`,
    `venues`.`venue_phone`,
    `venues`.`venue_url`
  FROM `tfd5_events_main` AS `events`
  LEFT JOIN `tfd5_events_venues` AS `venues` ON `events`.`event_venue` = `venues`.`venue_id`
  WHERE `event_datetime` >= $date
  AND `event_published` = 1
  ORDER BY `event_datetime`;
";
$db->setQuery($query);
$events = $db->loadObjectList();
$form->data['events'] = $events;
?>
<div align="center">
<table width="600px" cellspacing="0" cellpadding="0" border="0">
 <thead>
   <tr>
    <td width="15%">DATE</td>
    <td>SCHEDULE</td>
    <td width="15%">TIME</td>
   </tr>
 </thead>

<?php
  foreach( $events as $e ):
    $date = $e->event_datetime;
    $date = strtotime($date);
    $date_d = date("n/d", $date);
    $date_t = date("g:i a", $date);
echo "
 <tbody>
  <tr>
   <td>{$date_d}</td>
   <td><a href='{$e->venue_url}' target='_blank'>{$e->venue_name}</a><br />{$e->venue_street}<br />{$e->venue_city}, {$e->venue_state} {$e->venue_zip}</td>
   <td>{$date_t}</td>
  </tr>
";
endforeach;
?>

 </tbody>
</table>
</div>


When I use the HTML action, I get the following error:

Warning: implode() [function.implode]: Invalid arguments passed in /home/content/t/a/n/tangerinemoon/html/events/administrator/components/com_chronoforms5/chronoforms/actions/html/html.php on line 506


When I do not use the HTML action, I do not. Do I need to use the HTML action? Any idea why this error is displaying when I do use the HTML action?

Rick
GreyHead 24 Jan, 2015
Answer
Hi Rick,

First, it's a Warning, not an Error, so the simplest fix is to set the Site Error Reporting to System Default (or to None) which should hide it.

The message is from deep in the code and I can't immediately see what is causing it :-(

The HTML (Render Form) action renders the HTML from the elements in the Designer tab (or a page on the Designer tab in a Multi-page form) - if you don't have any elements then you don't need it.

Bob

PS You have an unclosed <tbody> tag in the foreach loop of your code. Probably won't do any harm though.
momentis 26 Jan, 2015
Bob,

So sorry, it is a warning!! Oops!

It's not a big deal, as you point out I do not need the action. And thanks for catching the unclosed tag!

Rick
This topic is locked and no more replies can be posted.