Jump to content

How to get rid of FieldtypeMapMarker when 'uninstall (disabled)'


modifiedcontent
 Share

Recommended Posts

I was trying to uninstall the FieldtypeMapMarker module, that is connected with the problematic Google Maps API that has raised their prices and produces errors. I want to replace it with Leaflet Map Marker.

I uninstalled parts in the wrong order, hoping I could keep my address data. The module's uninstall is disabled, because the 'module is a Fieldtype currently in use by one or more fields'.

But admin for the field in question now produces this error:

Fatal Error: Uncaught Error: Call to a member function set() on null in /home/.../site/modules/FieldtypeMapMarker/FieldtypeMapMarker.module:54
Stack trace:

Reuploading/reinstalling the FieldtypeMapMarker module didn't fix access to the fieldtype admin.

I have tried uninstalling via the API, but don't understand how that works. I have tried putting this in a template file:

$modules->uninstall("FieldtypeMapMarker");

That didn't do anything. I guess I have to put this in a function or "hook" it somewhere? I have no clue.

Or would this method still perform the same check if I am allowed to uninstall?

How can I nuke FieldtypeMapMarker without doing more damage? Is deleting rows in mysql really the best option? Is there a somewhat clean way to force uninstall and/or replace FieldtypeMapMarker with the Leaflet alternative?

 

Link to comment
Share on other sites

Not sure if it will work, but you might try Tracy's Admin Tools panel when you are on the field edit page to delete the field.

Otherwise it might be a database manipulation fix. Actually you've got me thinking that it might be good to have a new Admin Tool for force deleting problematic modules because I have come across stuff like this before and it can be painful to sort out.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@modifiedcontent - I have added that new "Delete Module" option to the Admin Tools panel. It will handle deleting modules when there are fieldtypes connected to the module and also when there are other modules that require the module you're trying to delete.

I haven't tested it with a "broken" situation like you are describing and it actually probably isn't what you want because it will automatically delete the connected fieldtypes, so there will be data loss, so this is probably not what you want.

Actually, now that I think of it, maybe the "Change field type" Admin tool will help you convert to the leaflet fieldtype?

  • Thanks 1
Link to comment
Share on other sites

Thank you so much adrian. I had been using your Admin Actions module for other things. Super useful. I should have thought of trying that sooner. 

I have first applied 'Copy Content to Other Field', then used 'Delete Unused Fields'. Both no problems. 

More clean-up work to do before I can declare victory. I would be pleasantly surprised if the data really is still there, but at least the old fieldtype is gone. Will report back...

  • Like 1
Link to comment
Share on other sites

2 hours ago, modifiedcontent said:

I had been using your Admin Actions module for other things.

Glad Admin Actions was useful for you, but just keep in mind that I was actually referring to the new Admin Tools panel in Tracy.

Also, regarding the  'Copy Content to Other Field' in the Admin Actions module - did that actually work for the map data? I haven't tested it with multivalue fields, but if it worked, that's great. If it didn't, then it is something I should enhance it to do at some point.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...