• Resolved reidbusi

    (@reidbusi)


    Hi, I am having trouble with the plugin. Using the post locator, I edit a post, add a location (looks good, confirmed, coords) then save the post and reload it in the editor and the location has not been saved. It just says “No location found”. There is no error in the js console.

    I have it set to use Leaflet & Nominatum in the Maps & Geocoders settings.

    So, to be fair I tried it on a completely fresh WordPress install on a different domain. Same result. (first site was WP 4.9.10, second fresh install site is WP 5.1.1)

    Note that the new gutenthingy editor does not actually reload the post edit page when you publish/update it, so you will not see this error unless you close that window and reopen the post for editing.

    The result is that no locations are saved (even though the geolocation appears to be working), so the results form and map I have configured show nothing (because no data was saved).

    Server environment:
    CentOS Linux 7.6.1810
    Apache 2.4.6
    PHP 7.2.16 (FCGId)
    MariaDB 5.5.60

    Am I missing something?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter reidbusi

    (@reidbusi)

    Same result in Firefox and Chromium.

    Also tried trunk version of plugin from git. Same result.

    Does anyone have the current version of the plugin working with Leaflet/Nominatum? (able to add and save new locations?)

    I have not tried it with Google Maps because I refuse to cave to google on that (would be different if they had charged from the start). I wonder if everyone is using it with Google maps and thus no one has noticed this?

    Thread Starter reidbusi

    (@reidbusi)

    Found the problem:

    mod_fcgid: stderr: WordPress database error Invalid default value for ‘created’ for query CREATE TABLE wp_gmw_locations (, referer: https://exammple.com/wp-admin/plugin-install.php?s=Geo&tab=search&type=term

    includes/class-gmw-installer.php(190):

    			// generate table sql
    			$sql = "CREATE TABLE $locations_table (
    				ID BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    				object_type VARCHAR(20) NOT NULL,
    				object_id BIGINT(20) UNSIGNED NOT NULL default 0,
    				blog_id BIGINT(20) UNSIGNED NOT NULL default 0,
    				user_id BIGINT(20) UNSIGNED NOT NULL default 0,
    				parent BIGINT(20) UNSIGNED NOT NULL default 0,
    				status INT(11) NOT NULL default 1,
    				featured TINYINT NOT NULL default 0,
    				title TEXT,
    				latitude FLOAT( 10, 6 ) NOT NULL,
    	  			longitude FLOAT( 10, 6 ) NOT NULL,
    				street_number VARCHAR( 60 ) NOT NULL default '',
    				street_name VARCHAR( 144 ) NOT NULL default '',
    				street VARCHAR( 144 ) NOT NULL default '',
    				premise VARCHAR( 50 ) NOT NULL default '',
    				neighborhood VARCHAR( 96 ) NOT NULL default '',
    				city VARCHAR( 128 ) NOT NULL default '',
    				county VARCHAR( 128 ) NOT NULL default '',	
    				region_name VARCHAR( 50 ) NOT NULL default '',
    				region_code CHAR( 50 ) NOT NULL,
    				postcode VARCHAR( 24 ) NOT NULL default '',
    				country_name VARCHAR( 96 ) NOT NULL default '',
    				country_code CHAR( 2 ) NOT NULL,
    				address varchar( 255 ) NOT NULL default '',
    				formatted_address VARCHAR( 255 ) NOT NULL,
    				place_id VARCHAR( 255 ) NOT NULL,
    				map_icon VARCHAR(50) NOT NULL,
    				/*radius NUMERIC( 6,1 ) NOT NULL,*/
    				created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    				updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    				PRIMARY KEY ID (ID),
    				KEY coordinates (latitude,longitude),
    				KEY latitude (latitude),
    				KEY longitude (longitude),
    				KEY object_type (object_type),
    				KEY object_id (object_id),
    				KEY blog_id (blog_id),
    				KEY user_id (user_id),
    				KEY city (city),
    				KEY region (region_name),
    				KEY postcode (postcode),
    				KEY country (country_name),
    				KEY country_code (country_code)
    			) $charset_collate;";

    My version of MariaDB is too old to support CURRENT_TIMESTAMP defaults on DATETIME fields. (was added in MySQL 5.6.x)

    Stewing on a workaround, I don’t want to have to update MariaDB if I don’t have to.

    Thread Starter reidbusi

    (@reidbusi)

    modifying the created and updated fields to:

    	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    	updated DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01' ,

    Seems to work for me so far, not sure if it will break location caching though? I haven’t examined the plugin code closely enough to tell.

    I couldn’t bring myself to rebuild my server to update MariaDB right now.

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @reidbusi,

    Only yesterday another user contacted me regarding the same exact issue. And just the same we found out that he was using MySQL version older than 5.6.

    He ended up upgrading his server so the issue was resolved.

    I am going to apply a fix and will release a new version ASAP.

    I believe that I will do something like:

    
    created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
    

    Anyway, I am glad you managed to get it working for now.

    Thread Starter reidbusi

    (@reidbusi)

    Hi @ninjew,

    Thanks for the reply. That’s a funny synchronicity that another user found the same thing at the same time. I do need to update my MariaDB installation, but I just didn’t have the time right now.

    If you use zero time defaults watch it does not cause “strict” issues. It may be better to use the epoch start and then address all the logic in the code as needed.

    I’m on the way to a full implementation with your plugin and I have to say I am quite pleased with the result. You have obviously put a lot of work into this and it shows.

    I’ll share the completed link to my usage of it if my client is OK with it so you can see what I’ve done with it.

    When I get paid, I will send a donation if I can. I want to support this. Nice work.

    P.S. and the plugin name is badass! ??

    Thread Starter reidbusi

    (@reidbusi)

    Hi @ninjew, I made a small donation. It’s not much, just a little thanks for the cool plugin.

    This is where I used it:
    Store Locator | Nature’s Natural Solutions Goat Milk Skin Care.
    The client really likes it, so I have to give credit where credit is due. (That’s you!).

    I will be using it again (already have it in a project that is not public yet).

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hi @reidbusi,

    Thank you so much for the donation and the kind words. I truly appreciated it and it means a lot to me knowing that my work is being useful and appreciated by others.

    Thank you ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘No location found after editing post’ is closed to new replies.