[solved]Invalid argument supplied for foreach() CGExtentions

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

[solved]Invalid argument supplied for foreach() CGExtentions

Post by pedes »

Hello,

I'm using for a CMSMS website, modules Compagny Directory en Postcode.
In this website there is a search that return a list of Compagny Directory based on the given postalcode. And also shows the Compagny locations in a map.
I can search in 4 country with a drop down list (see the error).

This works fine, until i upgraded the modules postcode (and the cgextentions module, because the latest postcode module needs the latest cgextentions module).
After this upgrade i get a error in the admin of postcode module and in the frond-end (see attached files).

Code: Select all

Warning: Invalid argument supplied for foreach() in /home/mijnaccount/domains/mijndomein.be/public_html/modules/CGExtensions/CGExtensions.module.php on line 683
on the line 683 in the code of CGExtentions.module.php, i have this code:

Code: Select all

/*
   * A convenience function to create a country dropdown list
   */
  function CreateInputCountryDropdown($id,$name,$value='US',$selectone=false,$addtext='')
  {
    $tmp = $this->get_country_list();

    $countries = array();
    if( $selectone !== false ) $countries[$this->Lang('select_one')] = '';
    foreach($tmp as $row) {
      $countries[$row['name']] = $row['code'];
    }
    return $this->CreateInputDropdown($id,$name,$countries,-1,
                  strtoupper($value),$addtext);
  }
I already put back the previous version of postcode module, but i got the same error, so i asume this could be a problem from CGExtentions module ?

The search seems to work so far i have tested it, but i keep getting the error ?? And in the postcode module the country dropdown is empty (see attached file).
Anyone has any idea to solve this ?

My system information:
CMSMS: 1.11.7
CMSMailer 5.2.1
FileManager 1.4.3
MenuManager 1.8.5
ModuleManager 1.5.5
FormBuilder 0.7.3
Captcha 0.4.6
CGExtensions 1.37
JQueryTools 1.2.5
CGSimpleSmarty 1.7
CompanyDirectory 1.19.2
Postcode 1.2.1
CGGoogleMaps 2.4.7
FrontEndUsers 1.21.17
CustomContent 1.9
SelfRegistration 1.8
CGSmartImage 1.11


Thank you for reading this, hope to find some help.
Kind regards,
Peter
Attachments
fout_frontend.JPG
postcode_fout.JPG
Last edited by pedes on Sun Jul 28, 2013 6:38 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Invalid argument supplied for foreach() .. CGExtentions

Post by calguy1000 »

Please upgrade CGExtensions to 1.37.1

I fixed a bug.

Thanks.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: [solved]Invalid argument supplied for foreach() CGExtent

Post by pedes »

calguy,

I have to thank you very much for this.
The problem is solved with upgrading CGExtentions to version 1.37.1.

Thank you !

Kind regards
Peter
Post Reply

Return to “Modules/Add-Ons”