Geolocation - pins not showing and no search block

Since an upgrade to 2.51 ‘Browse Map’ in ‘Search’ had stopped working. Marker pins don’t show and there is no list of items under 'Find an Item on the Map , even with a search containing a few items.

I’ve tried reloading the Geolocation plugin - reloading a previously working version of my theme (Berlin based) - tried on different browsers - and the relevant files in the Application folder on the server don’t seem to have changed since the upgrade.

Looking at the console in my browser show the following - but I have no idea what to do about it:

XML Parsing Error: XML or text declaration not at start of entity
Location: http://theafteraliceproject.org/geolocation/map.kml?controller=map&action=browse&module=geolocation&search=&submit_search=Search+for+items&advanced[0][joiner]=and&advanced[0][element_id]=50&advanced[0][type]=contains&advanced[0][terms]=Leeds+Gate&collection=&user=&tags=&public=&featured=&exhibit=&geolocation-address=&geolocation-latitude=&geolocation-longitude=&geolocation-radius=0.1&only_map_items=true
Line Number 1, Column 2:
map.kml:1:2
XML Parsing Error: XML or text declaration not at start of entity
Location: http://theafteraliceproject.org/items/map?search=&submit_search=Search+for+items&advanced[0][joiner]=and&advanced[0][element_id]=50&advanced[0][type]=contains&advanced[0][terms]=Leeds+Gate&collection=&user=&tags=&public=&featured=&exhibit=&geolocation-address=&geolocation-latitude=&geolocation-longitude=&geolocation-radius=0.1
Line Number 1, Column 2:
map:1:2
Use of Mutation Events is deprecated. Use MutationObserver instead.

I’ve run out of ideas - can anyone help please? Here is an example search on the map

Sample map search

Omeka Classic 2.51, Geolocation plugin 2.25, Berlin theme 2.4,

This error is almost always caused by an extra blank line being printed before every page. Most of the time this is harmless, but for XML like the KML Geolocation uses, anything at all, including spaces or newlines, that appears before the first tag in the file causes an error.

In your case, if you view source on any page, you’ll see there’s a single space character being printed before anything else. Usually this is coming from a plugin that mistakenly has the offending whitespace outside of <?php ?> tags.

The easiest way to narrow it down is to deactivate (not uninstall, but deactivate) all your plugins but Geolocation and see if the problem is resolved. If so, you can add them back one by one and find which is the one causing the problem.

Thanks - I’ll try that.

OK - I disabled ALL other plugins, cleared the browser cache and the problem was still there. I have made some changes in the Geolocation plugin files so I’ll look there, but I’m sure it was working before. Thanks

I’ve just noticed that there is a new version of Geolocation plugin (2.26) - I’m on 2.25. Maybe I should install the new one??? How do I do this safely without losing all the map references in the items - I seem to remember having a problem with this about 2 years ago! Do I just Deactivate the old version first? Thanks.

You should just be able to delete the old plugin’s folder and replace it with the new one, without losing any locations. The locations are stored in your Omeka database, not the Geolocation plugin folder. Once you replace it with the new version, Omeka will automatically deactivate the plugin for you until you’ve clicked the Upgrade button for it on the plugins page.

If you’re concerned you can always back up your database before doing any upgrade. It’s never a bad decision to make a backup.

Thanks I’ll try that - may be a while 'cos very very slow connection at home, so I will have to wait till I get to the archive office to do the backup. Many thanks for your help on this, you’re a great team.

Hi again - I updated geolocation without any problems but the pins and the items list are still not working.

I see what you mean about the extra space in the page source - as I have already tried disabling all other plugins, is there somewhere else that I can look for the cause of this please?

Are there any other areas you can think of that you edited?

We’re pretty good at keeping this kind of problem out of our releases. That’s not to say that it’s impossible that it’s a bug, it’s fairly unlikely, if only because we haven’t seen other reports of this problem.

“Upgrading” to a clean copy of Omeka 2.5.1 could be a step to try if you can’t think of any other changed areas.

Thanks for getting back to me so quickly. I’ve checked every file that I’ve modified (quite a few) and found nothing. I do run another Omeka website that’s still on 2.5 and that doesn’t show the extra space before so I could upgrade that site to 2.51 and see if the issue appears there. Or I could do as you suggest and get a clean copy. Both involve a fair bit of work :frowning: I’ll take some time and have a good think before I do anything.

I did quite bit of googling on the extra white space problem and I wonder if it could be a BOM at the start that’s creating the white space - not sure how to track that down. Although I did check stuff on W3C internationalization checker and it couldn’t see one so prob not.

Anyway big thanks for your time on this- I will of course let you know how I get on.

Best wishes for Christmas and the New Year - Cheers ‘H’

The thing about modified files is that the “problem” is going to be pretty small and unassuming: it’s just having some extra spaces or blank lines at the beginning or even the end of the file, so it could be easy to miss. If you added new opening or closing <?php or ?> tags those would be areas where it’s easy to make this mistake.

Do you have a sense on the number of files changed, or what particular ones they are? One clue is that this space is turning up on every page, meaning the public and admin themes aren’t going to be where the problem is. Instead, it’s some file Omeka uses on every request, like bootstrap.php, or application/views/scripts/custom.php (there are many more examples, too, of course).

Thanks (yet again) - I will double check again.

To quote Captain Oates: “I am just going outside and may be some time.” :wink:

OK. I finally managed to track down the problem. The culprit that was adding an extra space at the start of every page (even in admin view) was the Helpers plugin - (https://github.com/Daniel-KM/Omeka-plugin-Helpers) - which I had not modified.

BUT deactivating it did not resolve the problem - I had to Uninstall it.

Hope this helps others. Thanks for all your suggestions.