Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

SiteInvoice - invoices

#181

Open the tools >> siteinvoice app and the following error occurs

Warning: Invalid argument supplied for foreach() in /home/semias/public_html/github.sitellite.nl/inc/app/siteinvoice/lib/PEAR/Services/ExchangeRates/Currencies_UN.php on line 78

Warning: Invalid argument supplied for foreach() in /home/semias/public_html/github.sitellite.nl/inc/app/siteinvoice/lib/PEAR/Services/ExchangeRates.php on line 231

Reported by semias · March 16th, 2011 @ 02:33 PM

State: resolved
Milestone: 5.0.4
Assigned to: semias semias

Activity

  1. semias
    semias

    Where is the install/siteinvoice/index.php used for?

    March 16th, 2011 @ 02:37 PM

  2. semias
    semias
    • State changed from open to resolved

    Cause: A foreach loop is executed according to the following parameters:

    foreach($array as $key => $value) { actions; }
    

    If $array is empty/null, it results in a warning because a system simply cannot assign values to non-existing keys.

    Solution: To fix these types of issues, a simple if loop has to be added before the foreach loop is executed to check whether or not $array is empty.

    if ($array) { 
        foreach($array as $key => $value) { 
            actions; 
        } 
    }
    

    This means the foreach loop will be skipped altogether if $array is empty/null.

    March 18th, 2011 @ 04:29 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.