Page 1 of 1

PHP Warning and Errors

PostPosted: Thu Jun 03, 2010 3:03 pm
by cantlep
Hiya,

In my apache logs, I'm getting the following:

Code: Select all
PHP Notice:  Undefined index: alias in /var/www/html/public/dataface/Dataface/Table.php on line 2046, referer: http://www.dogbiscuit.org.uk/index.php?-table=BillData&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=BillData%3FBillDataID%3D16&-relationship=SiteData
PHP Warning:  ucfirst() expects parameter 1 to be string, array given in /var/www/html/public/dataface/Dataface/Table.php on line 2385, referer: http://www.dogbiscuit.org.uk/index.php?-table=BillData&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=BillData%3FBillDataID%3D16&-relationship=SiteData
PHP Warning:  Illegal offset type in /var/www/html/public/dataface/Dataface/Table.php on line 2047, referer: http://www.dogbiscuit.org.uk/index.php?-table=BillData&-action=related_records_list&-cursor=1&-skip=0&-limit=30&-mode=list&-recordid=BillData%3FBillDataID%3D16&-relationship=SiteData


Because of this line in BillData/BillData.php
Code: Select all
function __sql__(){
        return "select t.*, datediff(t.SupplyPeriodEnd,t.SupplyPeriodStart) as StandingChargeUnits, t.TotalCostExVAT*t.MPAN1LowerVATPerc/(100)*t.LowBillDataVATRates+t.TotalCostExVAT*t.MPAN1HigherVATPerc/(100)*t.HighBillDataVATRates as VAT, t.TotalCostExVAT*t.MPAN1LowerVATPerc/(100)*t.LowBillDataVATRates+t.TotalCostExVAT*t.MPAN1HigherVATPerc/(100)*t.HighBillDataVATRates + t.TotalCostExVAT AS BillTotal from BillData t";
}


Have I made an error with the code? It works as far as I can tell but I guess somewhere, the framework doesn't like it.

Can you shed any light?

Cheers

Paul

Re: PHP Warning and Errors

PostPosted: Mon Jun 07, 2010 9:39 am
by shannah
Currently the SQL parser can't handle in-line arithmetic (e.g. 10*5 or columnname*100)... This is likely what it is objecting to. I was a little surprised when you originally showed your solution that involved this arithmetic when you said that it was working...

that's my best guess right now.

Re: PHP Warning and Errors

PostPosted: Mon Jun 07, 2010 1:54 pm
by cantlep
Hi Steve,

Ah right. I've seen you mention this before. Yeah, the code works fine. The calculations are correct so there're no issues there. I'll just ignore the errors for now :-)

Thanks

Paul