Mapping: after an upgrade, all geo-data is gone

I just upgraded Mapping from 1.4 to 1.5; after doing so, no pins appear on the map and the “Mapping” tab of each item’s edit screen is reset.

I did that upgrade right after upgrading Omeka-S from 3.0.1 to 3.1.1, and I didn’t think to look at the map between the two upgrades; it’s also possible that the Omeka update broke something.

So this appears to be that the database mapping records got disconnected somehow, but now I’m getting out of my own ability to troubleshoot.

There doesn’t appear to be any changes in Mapping 1.4 to 1.5 and Omeka S 3.0.1 to 3.1.1 that would account for there to be no markers showing up when viewing the item edit page. To be clear, do you see the markers on the item show page? Open your browser’s web development tool and see of there’s a JavaScript error in the console.

The markers do not appear on the item show page unless I go back and add a location again. In other words, the system works as expected but has lost all prior location data. You can see the map, where you’ll see the one location I’ve re-set; and you can see that one pin on that one item’s show page. But no other items show on the map, have a location marked in their Mapping tab, or show a map or location on their show page.

There are no JS errors in the console (though there are some CSS errors, mostly in unknown defined properties).

Hmm. Try this: open the Module.php file in the modules/Mapping directory and comment out the following lines, like this:

        // $em = $this->getServiceLocator()->get('Omeka\EntityManager');
        // $filter = $em->getFilters()->getFilter('resource_visibility');
        // $filter->addRelatedEntity('Mapping\Entity\Mapping', 'item_id');
        // $filter->addRelatedEntity('Mapping\Entity\MappingMarker', 'item_id');

Go to an item that has mapping data that you haven’t already edited and see if the markers appear. It may be that there’s a visibility issue, but I doubt it.

(Be warned that if you edit an item that once had mapping data but no longer does, you’ll likely lose the old mapping data after you submit.)

Tested, unfortunately no change.

Because I’ve suspected that item edits would lose the old mapping data, I’ve been careful to make sure we don’t touch any of those items (other than the one I’ve used for testing).

If you can, take a look at your database, in the mapping and mapping_marker tables. Do you see any rows that would’ve existed before you made the upgrade?

During an upgrade, the module would’ve made no changes to the database. It could be something went wrong during your upgrades, like the module was uninstalled and reinstalled, rather than upgraded, which would account for deleted mapping data with an otherwise working module.

Looking at the current database, the mapping_marker table is empty except for the one test entry I’ve made. I peeked into a backup of the database prior to the upgrade, and all the data is there. So I think you nailed it — I must have done the upgrade incorrectly; painful lesson learned. I went back and inserted/updated the mapping_marker entries, and all is back to normal. Thanks so much for the help!