ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Geotagger add-on error in EE 2.7+

April 18, 2014 10:03am

Subscribe [3]
  • #1 / Apr 18, 2014 10:03am

    Has anyone gotten the add-on Geotagger working in EE 2.7+? The developer, Mighty Big Robot, has dropped support for this product.

    EE deprecated the way in which the fieldtype was constructed in 2.6. In the Developer Log, you see:

    Deprecated function EE_Fieldtype() called in system/expressionengine/third_party/geotagger/ft.geotagger.php on line 47.
    Deprecated since 2.6. Use EE_Fieldtype::__construct() instead.

    So I changed line 47 of ft.geotagger.php from

    parent::EE_Fieldtype();

    to

    EE_Fieldtype::__construct();

    which got it to install successfully in EE 2.8, but it’s still not working. When I put in my location information and hit “Geotag Entry”, it displays

    Geocode was not successful for the following reason: ZERO_RESULTS

    I also tried

    parent::__construct();

    but got the same results - zero.

    Has anyone gotten this add-on to work? Is there some other portion of the plugin code that needs to be changed?

    Thanks!

  • #2 / Apr 18, 2014 10:13am

    Musa just posted this solution on another thread:

    I’ve made it working. I had to do a dirtcy hack in native EE fieldtype code, if you’ve used only text fieldtype for geotagging, you should replace following code in /system/expressionengine/fieldtypes/text/ft.text.php

    $field = array(
       'name'  => $this->field_name,
       'value'  => $this->_format_number($data, $type),
       'dir'  => $this->settings['field_text_direction'],
       'field_content_type' => $type
      );

    by

    $field = array(
       'id'  => $this->field_name,
       'name'  => $this->field_name,
       'value'  => $this->_format_number($data, $type),
       'dir'  => $this->settings['field_text_direction'],
       'field_content_type' => $type
      );

    Line 101-106. Actually EE dropped ID attribute for input field which causes the issue.

    If you’re using any other field type(textarea or other) for geotagging, you’ve to do the same. Let me know if this solves your issue.

     

  • #3 / Apr 18, 2014 5:54pm

    I have tried this solution and can verify that this works in EE 2.8.1

    My only issue is that it requires a system hack, which is never a good idea. Anyone else found a way to adjust the fieldtype, so this is not necessary?

  • #4 / Apr 21, 2014 1:24pm

    Marin Bikes's avatar

    Marin Bikes

    45 posts

    I got this to work by changing the code in the Geotagger javascript. It stops working because the new version of EE does not add id’s to its fields so the jquery code cannot access the fields.

    Here is what worked for me. Changes to geotagger.js in the theme

    https://gist.github.com/gwincr11/11149519

  • #5 / Apr 21, 2014 4:43pm

    Brilliant, CG11!!

    I unhacked the fieldtype code, updated the theme javascript with your version, and it works like a dream in EE 2.8.1.

    Thank you so much. 😊

  • #6 / Apr 21, 2014 4:52pm

    Marin Bikes's avatar

    Marin Bikes

    45 posts

    No problem. I have a fix for geofinder as well if you need it.

  • #7 / Apr 21, 2014 5:01pm

    Yes, please!

    I don’t have Geofinder on any of my sites, but I’m sure other folks out there are looking for a solution and can test it.

  • #8 / Dec 08, 2014 1:43pm

    kencheung

    5 posts

    I used your code, but I’m still getting a fatal error in v2.9.2:

    “Fatal error: Call to undefined method EE_Fieldtype::EE_Fieldtype() in /system/expressionengine/third_party/geotagger/ft.geotagger.php on line 47”

    I got this to work by changing the code in the Geotagger javascript. It stops working because the new version of EE does not add id’s to its fields so the jquery code cannot access the fields.

    Here is what worked for me. Changes to geotagger.js in the theme

    https://gist.github.com/gwincr11/11149519

  • #9 / Dec 08, 2014 1:51pm

    Marin Bikes's avatar

    Marin Bikes

    45 posts

    Hi kencheung,

    I actually passed my code fixes on to the maintainer of the plugin some time ago. So the newest version should be working properly. Try updating the plugin.

    Cory

  • #10 / Dec 08, 2014 2:17pm

    kencheung

    5 posts

    Hi Corey,

    Thank you for the quick response. According to their website, the latest version is 3.0.4, which is the version we already have. I replaced geotagger.js with your version, but I still get the same error. Is there another file I need to change?

    Ken

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases