JoryHogeveen / pods-address-maps

This repo contains two addon plugins for dev purposes: Pods Address field & Pods Maps component
20 stars 7 forks source link

php 8 breaks google map and Geocode in backend, WP 6.5.2 php > 7.4, PODs.io V. 3.2.1, pods-address-maps GitHub-Version #17

Open oligoform opened 4 months ago

oligoform commented 4 months ago

The input fields for the address are shown in WP Backend but then a lot of warnings „Undefined variable“: _Warning: Undefined variable $form_fieldtype in /wp-content/plugins/pods-address-field/ui/fields/address.php on lines 12, 34, 39, 44, 49, 54, 63, 73

The Map and of course then, the Address-Lookup isn’t there.

The Errors/Warnings are gone If I define the Variable in /wp-content/plugins/pods-address-field/ui/fields/address.php on line ~ 6 like this:

//fix for php8
if ( empty( $form_field_type ) ) {
    $form_field_type = '';
}
//added before this line:
$attributes             = PodsForm::merge_attributes( $attributes, $name, $form_field_type, $options );

but unfortunately no Map or Lookup.

Do you have a hint where to look for a fix?

JoryHogeveen commented 4 months ago

Hi @oligoform

This plugin stems from pre-React fields in Pods and needs a big refactor to be properly integrated in Pods 2.8+. However, I use it myself on a website which works find there. Did you fill in your Google Maps API information?

As for the fix for PHP8, please make a PR so I can check and merge :)

Cheers, Jory

oligoform commented 4 months ago

Hi @JoryHogeveen of course I have filled the google maps key (now with the needed payment-information for google)!

I´ll prepare the PR but it's only a quick-fix for the errors. No Map and no geocoding possible