Joomla.it Forum

Componenti per Joomla! => Gestione Form => : rgil65 12 Sep 2014, 16:44:03

: Chronoforms V5 - Custom code FOREACH error
: rgil65 12 Sep 2014, 16:44:03
Ciao a tutti.
Sto utilizzando chronoforms V5, nel porting di una form da V4 ho aggiunto un solito CUSTOM CODE e ho ottenuto come errore

Fatal error: Call to undefined method stdClass::addJsCode() in /web/htdocs/www.icgramscicamponogara.it/home/administrator/components/com_chronoforms5/chronoforms/actions/html/html.php on line 466

ho indagato e ho visto che il problema si produce perché all'interno del mio PHP no un loop foreach

foreach ($result as $doc)
{
    ........      

}
 se lo tolgo non viene prodotto l'errore.   Come posso risolvere ? Ho cercato dappertutto ma non ho trovato risposte.


: Re:Chronoforms V5 - Custom code FOREACH error
: vales 14 Sep 2014, 21:37:45
dipende da cosa c'è nel foreach probabilmente
: Re:Chronoforms V5 - Custom code FOREACH error
: rgil65 15 Sep 2014, 00:44:09
All'interno del foreach va in errore anche se non c'è nulla
: Re:Chronoforms V5 - Custom code FOREACH error
: vales 15 Sep 2014, 19:24:17
Generalmente un foreach è utilizzato per scorrere gli array generati da una query su tabella di database. Se è questa la tua situazione controlla di aver definito bene l'array  $result che dovrebbe contenere i records letti dalla query.