• Resolved Daedalon

    (@daedalon)


    The location map doesn’t show on front-end edit event page nor the wp-admin edit event page on loading the page. When loading the edit location page the map is displayed immediate upon loading the page.

    The fix was to move in the template file forms/event/location.php lines 25-28, which were

    <div id="location_coordinates" style='display: none;'>
    		<input id='location-latitude' name='location_latitude' type='text' value='<?php echo $EM_Location->location_latitude; ?>' size='15' />
    		<input id='location-longitude' name='location_longitude' type='text' value='<?php echo $EM_Location->location_longitude; ?>' size='15' />
    	</div>

    and place them before the last closing </div>, just like in forms/location/where.php:

    <br style="clear:both;" />
    	<div id="location_coordinates" style='display: none;'>
    		<input id='location-latitude' name='location_latitude' type='text' value='<?php echo $EM_Location->location_latitude; ?>' size='15' />
    		<input id='location-longitude' name='location_longitude' type='text' value='<?php echo $EM_Location->location_longitude; ?>' size='15' />
    	</div>
    </div>

    http://wordpress.org/extend/plugins/events-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    this was fixed a few versions ago, are you on 5.2.4?

    Thread Starter Daedalon

    (@daedalon)

    This defect appears in the templates/forms/event/location.php of 5.2.4: http://downloads.wordpress.org/plugin/events-manager.5.2.4.zip

    I remember a somewhat similar bug fixed right in 5.1.9 based on my report, but it wasn’t the same one. It affected all the pages that showed the location information, for one. Possibly it was related to the location data being saved into the db without latitude and longitude, since I’ve found locations missing those.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    tested this on a few sites and it works fine.

    have you tried without other plugins disabled? The original problem didn’t affect location pages, only edit pages, so it may still be a conflict on your side.

    Thread Starter Daedalon

    (@daedalon)

    On our site the problem affected only event edit pages, as described in the first post. Haven’t tested without other plugins, figured that they’re unlikely the reason as eg. location edit pages work fine.

    The reason for the problem is that div#location_coordinates, which uses the $EM_Location->location_latitude variable, was on lines 25-28 of templates/forms/event/location.php, but global $EM_Location is called as late as on line 56. This is why moving div#location_coordinates to the end of the file worked. The notion for doing this I got by looking at templates/forms/location/where.php, where you had already done so.

    I’m surprised if the edit event pages show the map on any site using the default templates/forms/event/location.php of 5.2.4. Are you sure those are the exact conditions you checked for?

    This issue doesn’t affect our site anymore after overriding the default template with a fixed one. I’ve opened and continued this thread only as charity to help the bulk of EM uses enjoy the fix from core, hopefully in the release right after the brand new 5.2.5 😉

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    In my template, i use

    $EM_Event->get_location()->location_latitude

    i think you still must have an oudated template

    Thread Starter Daedalon

    (@daedalon)

    You’re correct. I didn’t spot that change. Will go through the changes in templates between versions more systematically from now on. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Events Manager] [PATCH] Map doesn't load on edit event pages’ is closed to new replies.