[freeside-users] Three minor Freeside 4.1 bugs with workarounds

Erreu Gedmon eg at keyway.net
Wed Oct 5 21:14:30 PDT 2016


I found a couple of bugs in 4.1. Here are my workarounds.

Freeside 4.1 Import.pm bugs

Name: Error: Illegal payby: BILL
Description: Properly formatted Batch Customer Import file triggers
error: "Illegal payby: BILL" in cust_main.pm
Expected: Properly formatted import file should not trigger errors.
Reproduce: Create Batch Customer Import file with null payinfo field.
Affects: .csv Batch Customer Imports in Freeside 4.1
Cause: Possibly caused by deprecation of the payby field?
Workaround: modify import module /usr/share/perl5/FS/cust_main/Import.pm
            Change $payby = 'BILL'; to $payby = ''; in the relevant
elseif section(s)
Notes: I'm not quite sure what the programmers intent was when they set
this field to 'BILL'. So I'm not recommending
       this workaround be implemented as a fix.

Name: Can't edit imported creditcard or e-check data
Description: payinfo field content is not displayed and cannot be edited
after Batch Customer Import.
Expected: Edit Customer should display the payinfo field content and
permit editing.
Reproduce: Import Batch Customer Import file with valid content in
payinfo field.
Affects: .csv Batch Customer Imports in Freeside 4.1
Cause: payinfo,paycvv, and paydate are inserted into table cust_main
instead of table cust_payby
Workaround: manually enter all payinfo data (safe), or run an upgrade
(less safe, wfmymmv)...
             /etc/init.d/freeside stop ; systemctl stop apache2 ;
systemctl restart postgresql
             su -l freeside -c "freeside-upgrade fs_daily"
             systemctl start apache2 ; /etc/init.d/freeside start
             Check Reports; Logs; System Logs for errors...
Notes: n/a

Freeside 4.1 selfservice.cgi bug

Name: Error: "Illegal username, domain."
Description: Selfservice login fails with error "Illegal username,
domain." if contact email address contains a plus (+) sign
Expected: Successful login should be possible with any valid email address.
Reproduce: Enter any contact email containing a plus sign, attempt to
login with selfservice.cgi.
Affects: Selfservice login in Freeside 4.1
Cause: Email validation regex in selfservice.cgi doesn't check for the
plus (+) sign.
Workaround: wfmymmv Change the following line in selfservice.cgi from:
                if ( $cgi->param('email') =~
/^\s*([a-z0-9_\-\.\@]{1,$form_max})\s*$/i ) {
             to:
                if ( $cgi->param('email') =~
/^\s*([a-z0-9_\-\.\+\@]{1,$form_max})\s*$/i ) {
Notes: Perhaps using Email::Address would be a better way to
validate/sanitize email addresses?
       (Unless this behaviour was intentional? I noticed references in
the java code to "fix unescaped plus signs".)


-- 
Erreu Gedmon

--
"You see persons and things not as they but as you are."
        -- Anthony De Mello



More information about the freeside-users mailing list