Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Three times in the geocoder_field.module file array_filter
is used along with the option ARRAY_FILTER_USE_BOTH
. However, this option is only available as of PHP 5.6 (see the array_filter docs on php.net). The option passes both the array value and the associated key to the callback function, but the key is never used by the functions in this file. Because PHP 5.6 is only available on 11-20% of servers (stats from w3techs.com and wordpress.org), this option flag should probably be removed. On PHP versions below 5.6, it results in the following errors:
Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in geocoder_field_widget_get_field_value() (line 330 of /home/emergencyleash/public_html/sites/emergencyleash.com/modules/geocoder/modules/geocoder_field/geocoder_field.module). Warning: array_filter() expects at most 2 parameters, 3 given in geocoder_field_widget_get_field_value() (line 330 of /home/emergencyleash/public_html/sites/emergencyleash.com/modules/geocoder/modules/geocoder_field/geocoder_field.module). Warning: uasort() expects parameter 1 to be array, null given in geocoder_field_widget_get_field_value() (line 345 of /home/emergencyleash/public_html/sites/emergencyleash.com/modules/geocoder/modules/geocoder_field/geocoder_field.module). Warning: array_keys() expects parameter 1 to be array, null given in geocoder_field_widget_get_field_value() (line 346 of /home/emergencyleash/public_html/sites/emergencyleash.com/modules/geocoder/modules/geocoder_field/geocoder_field.module). No plugin could geocode: "100 Main St New York, NY 10001 US".
Comment | File | Size | Author |
---|---|---|---|
#2 | geocoder-array_filter_use_both-2758983-1.patch | 1.88 KB | thirdender |
Comments
Comment #2
thirdender CreditAttribution: thirdender commentedComment #4
PolThanks.