Fatal error: Call to undefined function eventListing() in C:\wamp\www\Hurst\assets\snippets\eform\eform.inc.php on line 139
<option value="[+description+]">[+description+]</option>
<select>
<option value="please choose one">Please choose one</option>
[!Ditto? &parents=`29` &tpl=`eventListings` &display=`100` &total=`100` &sortBy=`menuindex DESC` !] </select>
<?php
function eventListing(&$fields, &$templates){
global $modx;
$ditto_params = array(
'parents' => 29',
'tpl' => 'eventListings',
'display' => '100',
'total' => '100',
'sortBy' => 'menuindex DESC'
);
$templates['tpl'] = str_replace('[+eventListings+]',$modx->runsnippet('Ditto',$ditto_params),$templates['tpl']);
return true;
?>
[!eventListing!] <div>[!eForm? &formid=`eventsRegistration` &tpl=`eventsForm` &eFormOnBeforeFormParse=`eventListing` &debug=`0` &report=`eventsReport` &thankyou=`eventsThanks` &vericode=`1` &to=`[email protected]` !]</div>
<div id="event" class="required">
<label for="event">Event:</label>
[+eventListings+]
</div>

Hello, hope someone can help me on this as I have hit a wall now and am not sure where to go from here. I am trying to add an event listing drop down to an eform.
(...)
After setting up the chunks and the snippets as set out in the posts I get the following error
Fatal error: Call to undefined function eventListing() in C:\wamp\www\Hurst\assets\snippets\eform\eform.inc.php on line 139
the ditto call in the select form element
<select> <option value="please choose one">Please choose one</option> [!Ditto? &parents=`29` &tpl=`eventListings` &display=`100` &total=`100` &sortBy=`menuindex DESC` !] </select>
Snippet call:
<?php function eventListing(&$fields, &$templates){ global $modx; $ditto_params = array( 'parents' => 29', 'tpl' => 'eventListings', 'display' => '100', 'total' => '100', 'sortBy' => 'menuindex DESC' ); $templates['tpl'] = str_replace('[+eventListings+]',$modx->runsnippet('Ditto',$ditto_params),$templates['tpl']); return true; ?>
eform call on the page
[!eventListing!] <div>[!eForm? &formid=`eventsRegistration` &tpl=`eventsForm` &eFormOnBeforeFormParse=`eventListing` &debug=`0` &report=`eventsReport` &thankyou=`eventsThanks` &vericode=`1` &to=`[email protected]` !]</div>
<option value="[+description+]">[+description+]</option>
<?php
function eventListingDropdown(&$fields, &$templates){
global $modx;
$ditto_params = array(
'parents' => '29',
'tpl' => 'eventListings',
'display' => '100',
'total' => '100',
'orderBy' => 'menuindex DESC'
);
$templates['tpl'] = str_replace('[+eventListings+]',$modx->runsnippet('Ditto',$ditto_params),$templates['tpl']);
return true;
?>
<select name="event" multiple> [+eventListings+] </select>
[!eventListing!] [!eForm? &formid=`eventsRegistration` &tpl=`eventsForm` &eFormOnBeforeFormParse=`eventListingDropdown` &debug=`0` &report=`eventsReport` &thankyou=`eventsThanks` &vericode=`1` &to=`[email protected]` !]
please disable rich-text editor for snippet calling content, too.... What do you mean by this exactly and how do you do it.
Fatal error: Call to undefined function eventListingDropdown() in C:\wamp\www\Hurst\assets\snippets\eform\eform.inc.php on line 139
with the eform call on the events page
[!eventListing!] [!eForm? &formid=`eventsRegistration` &tpl=`eventsForm` &eFormOnBeforeFormParse=`eventListingDropdown` &debug=`0` &report=`eventsReport` &thankyou=`eventsThanks` &vericode=`1` &to=`[email protected]` !]
Snippets:
[!eventListing!]
Chunks:
{{eventListings}}
{{eventsForm}}
The only thing I am not sure on is where you have putplease disable rich-text editor for snippet calling content, too.... What do you mean by this exactly and how do you do it.
Call to undefined function eventListingDropdown()
<?php
function eventListingDropdown (&$fields, &$templates) {
global $modx;
$ditto_params = array (
'parents' => '29',
'tpl' => 'eventListing',
'display' => '100',
'total' => '100',
'orderBy' => 'menuindex DESC'
);
$templates['tpl'] = str_replace('[+eventListing+]',$modx->runSnippet('Ditto',$ditto_params),$templates['tpl']);
return true;
?>
[!eventsList!] [!eForm? &formid=`eventsRegistration` &tpl=`eventsForm` &eFormOnBeforeFormParse=`eventListingDropdown` &debug=`0` &report=`eventsReport` &thankyou=`eventsThanks` &vericode=`1` &to=`[email protected]` !]
eForm configuration: array ( 'snipPath' => 'C:/wamp/www/Hurst/assets/snippets/eform/', 'snipFolder' => 'eform', 'vericode' => '1', 'formid' => 'eventsRegistration', 'from' => '[email protected]', 'fromname' => 'HURST', 'to' => '[email protected]', 'cc' => '', 'bcc' => '', 'subject' => '', 'ccsender' => '0', 'sendirect' => '0', 'mselector' => '0', 'mobile' => '', 'mobiletext' => '', 'autosender' => '', 'autotext' => '', 'category' => '0', 'keywords' => '', 'gid' => '31', 'noemail' => '', 'saveform' => '1', 'tpl' => 'eventsForm', 'report' => 'eventsReport', 'allowhtml' => '0', 'replyto' => '', 'language' => 'english', 'thankyou' => 'eventsThanks', 'isDebug' => '1', 'reportAbuse' => '', 'disclaimer' => '', 'sendAsHtml' => '', 'sendAsText' => '', 'sessionVars' => '', 'postOverides' => '0', 'eFormOnBeforeMailSent' => '', 'eFormOnMailSent' => '', 'eFormOnValidate' => '', 'eFormOnBeforeFormMerge' => '', 'eFormOnBeforeFormParse' => 'eventListingDropdown', 'cssStyle' => '', 'jScript' => '', 'submitLimit' => '0', 'protectSubmit' => '1', 'requiredClass' => 'required', 'invalidClass' => 'invalid', 'runSnippet' => '', 'autoSenderName' => '', 'version' => '1.4.4', )
<?php
function eventListingDropdown ( &$fields, &$templates ){
//do all your other stuff
$options = ditto_GetEventList(); //Get value for $options from ditto_GetEventList function, will be used for the dropdown options list
$templates['tpl'] = str_replace('[+eventListing+]', $options, $templates['tpl'] ); // Set the [+eventListing+] placeholder with the options value from the ditto
return;
}
function ditto_GetEventList() {
global $modx;
$params['parents'] = '29';
$params['tpl'] = 'eventListing';
$params['display'] = 'all';
$params['filter'] = 'id,31,2';
$params['orderBy'] = 'menuindex DESC';
$output = $modx->runSnippet('Ditto', $params);
return $output ;
}
?>
Here is my snippet code again and my eform call.
<?php function eventListingDropdown(&$fields, &$templates){ global $modx; $ditto_params = array ( 'parents' => '29', 'tpl' => 'eventListing', 'display' => '100', 'total' => '100', 'orderBy' => 'menuindex DESC' ); $templates['tpl'] = str_replace('[+eventListing+]',$modx->runSnippet('Ditto',$ditto_params),$templates['tpl']); return true; } // <- add function closing tag ?>
If you have any other suggestions will be very happy to hear them. Thanks again.