localgovdrupal / localgov_geo

Entity for storing Geographic information, addresses, and areas; extensible types and plugable backends with defaults to start.
2 stars 1 forks source link

Update on Drupal 10 not bringing fields accross on custom Geo entity #87

Closed andybroomfield closed 1 year ago

andybroomfield commented 1 year ago

Running a test ahead of our Drupal 10 upgrade. We have a custom geo entity called Parking Zones. It has two custom fields, Zone ID and Description.

On doing a test upgrade, we ran the drupal updates and found that the custom Geo entity, whilst created from the localgov_geo entity was missing all its fields.

Is it expected that we write our own update hook or should the localgov_geo_update module be handling that.

I did this is a clean localgov drupal install with a copy of the module that has the entity and ran the update there and same result.

Screenshot 2023-09-12 at 6 25 49 pm Screenshot 2023-09-12 at 6 20 57 pm Screenshot 2023-09-12 at 6 19 25 pm
andybroomfield commented 1 year ago

Just to add, nothing unusual in the logs, I see localgov_geo_update has executed updates 8001 to 8807 (theres a jump between 8005 and 8806 but assume that is intentional).

andybroomfield commented 1 year ago

This is beacause update hook 8003 is misspelled and does not get run.

Is

function localgov_geo_update_8003() {

Should be

function localgov_geo_update_update_8003() {

I guess it would be fine to retro fit this hook, given where it needs to run, we assume that sites that have already run this update didn't have custom geos to handle? /cc @ekes

andybroomfield commented 1 year ago

That seems to have brought over the fields, although the displays for the form and display had to be manually set up.

Screenshot 2023-09-13 at 1 04 21 pm
andybroomfield commented 1 year ago

I'm adding a test in #90 to prove migrating the existing custom localgov_geo entities work. I'm also adding a helper class to migrate the display modes.

andybroomfield commented 1 year ago

This is now resolved.