Hi there,
When searching an address it returns this error:
Warning: Invalid argument supplied for foreach() in /home/content/a2pnexwpnas02_data03/86/3555886/html/wp-content/plugins/wp-legisearch/public/functions.php on line 191
Warning: Cannot modify header information – headers already sent by (output started at /home/content/a2pnexwpnas02_data03/86/3555886/html/wp-content/plugins/wp-legisearch/public/functions.php:191) in/home/content/a2pnexwpnas02_data03/86/3555886/html/wp-includes/pluggable.php on line 1174
Can you please point us in the right direction?
Sorry for the delay. The Open States API is in transition as its owner, The Sunlight Foundation, is closing down. The error you are experiencing is due to a failure from the Open States API. I am unsure if they will be willing to fix it, but the issue has already been reported on the Google Group for the project.
The only two workarounds I can think of right now are: (1) Remove the address lookup. The error is specific to the geo-lookup part of their API. You can still lookup legislators by their state and chamber. (2) Modify the plugin to do your own geolookup to match a latitude and longitude to a legislative district. This is obviously more technical.
My plan with this plugin is to wait to see where the Open States API moves to and re-write the plugin to use the new API location.
According to a Sunlight Labs Tweet:
Location-based searches on @OpenStates are currently down, and we’re working on a fix now. Apologies for the inconvenience.
Marking as resolved as the this happened from a temporary data problem.