Topic: Import Transactions 2.3.22-4 2.3.22-4

When testing this feature I get the message

67 Payments would have been successful if imported. Uncheck Trial check before importing.

Around line 238 of /modules/import_transactions/import_transactions.php change

// Commit import to database
if ((isset($_POST['trial'])) && ($_POST['trial']==null)){     
    $trial = null;
}
if (isset($_POST['trial']) && ($_POST['trial']!=null)) {
     $trial = !null;
}

To

// Commit import to database
if ((isset($_POST['trial'])) && ($_POST['trial']==null)){     
    $trial = null;
}
if (isset($_POST['trial']) && ($_POST['trial']!=null)) {
     $trial = !null;
}

if (!isset($_POST['trial']) ) {
     $trial = null;
}

seems to do the trick.

HTH

G

Re: Import Transactions 2.3.22-4 2.3.22-4

What is the version of your PHP?

Re: Import Transactions 2.3.22-4 2.3.22-4

5.2.17

4 (edited by apmuthu 12/17/2014 04:31:27 am)

Re: Import Transactions 2.3.22-4 2.3.22-4

What is the meaning of $trial = !null; ? Is the value true or false? Is it's value dependent on PHP version used?

This logic can certainly do with some housekeeping.

Re: Import Transactions 2.3.22-4 2.3.22-4

I believe it sets the value to 1.

It is a very confusing way of testing if a box is checked or not.

It was failing to cater for the box not being checked.

if (isset($_POST['trial']) && ($_POST['trial']!=null)) {
     $trial = true;
} else {
     $trial = false;
}

Is probably neater.

HTH

G

Re: Import Transactions 2.3.22-4 2.3.22-4

$trial = (isset($_POST['trial']) && ($_POST['trial']!=null)) ;

is way better.

Re: Import Transactions 2.3.22-4 2.3.22-4

Code has been adjusted in the extension.

8 (edited by apmuthu 03/19/2015 03:28:43 pm)

Re: Import Transactions 2.3.22-4 2.3.22-4

Link to commit would be useful. Your commit list does not show it as yet.