Forums

Error message using mailform

LAMF 05 Oct, 2015
Hi,
I have been using Chronoforms v4 for a few years now and never encountered any issues.
Now I have changed host and when someone is using the contact form (using smtp mail in the Joomla global settings).
this error message appear:

Notice: Constant DS already defined in /mounted-storage/home133/sub015/sc87638-OQMM/gagneffiske.se/components/com_chronoforms/chronoforms.php on line 11

Strict Standards: Only variables should be assigned by reference in /mounted-storage/home133/sub015/sc87638-OQMM/gagneffiske.se/administrator/components/com_chronoforms/form_actions/custom_code/custom_code.php(19) : eval()'d code on line 2



URL to the form is:
http://www.gagneffiske.se/index.php/bild-a-film/ladda-upp-bilder/bilduppladdning-floda-bjorbo

Webhost support si telling me this:

I can see that you are using php 5.4. Kindly try to downgrade the php version to 5.2 and disable the php safe mode.



This action to downgrade to PHP 5.2 doesn't ound right to me especially as some components require 5.4 and above versions to work properly.

Do you have any suggestions regarding this issue?

Best regards,
LAMF (Micke)
GreyHead 05 Oct, 2015
Hi Micke,

Have you also changed the Joomla! version?

Please upgrade ChronoForms to the latest release of CFv4 for your Joomla! version.

The Strict Standards error is from some Custom Code - probably you have something like =& JFactory which now needs to be = JFactory.

And please set your site Error Reporting to System Default of None if this is a live site.

Bob
LAMF 06 Oct, 2015
Hi Bob,

Thanks for your reply.
Yes I have the newest Joomla 3.4.4 on my sites.
Chronoforms is updated since long also.
I do have some custom code:
A Load JS on the Events On Load looks like this:
window.addEvent('domready', function() {
  $$('a.multi-upload-add-attachment').each(function(el) {
    el.innerHTML = 'Bifoga bild';
    el.addClass('fvo-button');
  });
});


And also a Custom code Zip images:
<?php
$mainframe =& JFactory::getApplication();
jimport('joomla.filesystem.file');
 
// check if there are any files to zip
if ( count($form->files) < 1 ) {
return;
}
 
$files = array();
// loop through the files and unpack any arrays from the widget
foreach ( $form->files as $k => $f ) {
    if ( is_array($f) && !isset($f['name']) ) {
        foreach ($f as $kk => $ff ) {
            $files[$k.'_'.$kk] = $ff;
        }
    } else {
        $files[$k] = $f;
    }
}
 
$first_file = true;
foreach ( $files as $k => $f ) {
    if ( !JFile::exists($f['path']) ) {
        // check if the file exists
        continue;
    }
    if ( $first_file ) {
        // if it's the first file create the archive
        $zip_path = JFile::stripExt($f['path']).'.zip';
        $zip = new ZipArchive;
        $result = $zip->open($zip_path, ZipArchive::CREATE);
        if ( $result !== true ) {
            // unable to open ZipArchive
            return;
        }
        // create a new $form->files entry
        $form->files['upload_zip'] = array(
            'name' => $f['name'],
            'original_name' => '',
            'path' => $zip_path,
            'size' => '',
            'link' => str_replace(JPATH_SITE.DS, JURI::root(), $zip_path)
        );
        $first_file = false;
    }
    // add the file to the archive
    $zip->addFile($f['path'], $f['name']);
    // uncomment the next line to delete the original file
    //JFile::delete($f['path']);
}
$zip->close();
// update the size now the archive is complete
$form->files['upload_zip']['size'] = filesize($zip_path);
?>


Error reporting is set to None.

I dont find any errors like =& JFactory...

My host tells me this when I ask about their suggestion to downgrade to PHP v 5.2 (which to me sound no good at all:

If the application installed on your website needs safe_mode option to turn ON, then you will need to use PHP 5.2 version only. Because this option is compatible with PHP 5.2.

If you require Safe_mode option enabled for your website, then you cannot use PHP 5.3 or PHP 5.4



So I feel a bit stuck on square one...

Micke
GreyHead 06 Oct, 2015
Hi Micke,

Please see this line
$mainframe =& JFactory::getApplication();
There is the & you need to remove.

If your site error reporting is set to None then you need to edit your php.ini file to make sure that it is really turned off.

Bob
LAMF 06 Oct, 2015
Hi Bob!

This surely did the trick, big thanks!

All the best
Micke
This topic is locked and no more replies can be posted.