Hi Bob,
Thanks for that suggestion. I tried it, but unfortunately, the problem remains.
[21-Sep-2017 11:48:08 UTC] PHP Fatal error: Cannot redeclare CFavailable() (previously declared in /var/sites/mysite.com/public_html/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code:15) in /var/sites/mysite.com/public_html/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code on line 43
The error page also shows the code where this is happening...
Open:
/var
/sites
/mysite.com
/public_html
/administrator
/components
/com_chronoforms5
/chronoforms
/actions
/custom_code
/custom_code.php
<?php
/**
* ChronoCMS version 1.0
* Copyright (c) 2012 ChronoCMS.com, All rights reserved.
* Author: (ChronoCMS.com Team)
* license: Please read LICENSE.txt
* Visit http://www.ChronoCMS.com for regular updates and information.
**/
namespace GCore\Admin\Extensions\Chronoforms\Actions\CustomCode;
/* @copyright:ChronoEngine.com @license:GPLv2 */defined('_JEXEC') or die('Restricted access');
defined("GCORE_SITE") or die;
Class CustomCode extends \GCore\Admin\Extensions\Chronoforms\Action{
static $title = 'Custom Code';
function execute(&$form, $action_id){
$config = $form->actions_config[$action_id];
$config = new \GCore\Libs\Parameter($config);
$content = $config->get('content', '');
ob_start();
eval('?>'.$content);
$output = ob_get_clean();
echo \GCore\Libs\Str::replacer($output, $form->data, array('repeater' => 'repeater'));
}
public static function config($configs = array(), $extra_config = array()){
echo \GCore\Helpers\Html::formStart('action_config custom_code_action_config', 'custom_code_action_config__XNX_');
echo \GCore\Helpers\Html::formSecStart();
echo \GCore\Helpers\Html::formLine('Form[extras][actions_config][_XNX_][action_label]', array('type' => 'text', 'label' => l_('CF_ACTION_LABEL'), 'class' => 'XL', 'sublabel' => l_('CF_ACTION_LABEL_DESC')));
echo \GCore\Helpers\Html::formLine('Form[extras][actions_config][_XNX_][content]', array('type' => 'textarea', 'label' => l_('CF_CONTENT'), 'rows' => 15, 'cols' => 70, 'sublabel' => l_('CF_CONTENT_CUSTOM_CODE_DESC')));
echo \GCore\Helpers\Html::formSecEnd();
This line is highlighted...
eval('?>'.$content);
I'm guessing that something doesn't like a function being assigned to a variable...?
Any further thoughts?
Thanks.