Warning: Cannot use a scalar value as an array
Support › MB Geolocation › Warning: Cannot use a scalar value as an arrayResolved
- This topic has 14 replies, 2 voices, and was last updated 7 years, 1 month ago by
wkoehn.
-
AuthorPosts
-
September 14, 2018 at 2:42 PM #11338
wkoehn
ParticipantAny idea what could be causing this error?
Warning: Cannot use a scalar value as an array in /srv/users/hiddencreek307/apps/hiddencreek307/public/wp-content/plugins/meta-box-aio/extensions/meta-box-geolocation/inc/class-meta-box-geolocation.php on line 73
September 14, 2018 at 3:35 PM #11341wkoehn
ParticipantI'm using custom tables, maybe that has something to do with it?
September 14, 2018 at 4:03 PM #11343Anh Tran
KeymasterHi, can you post the code of your meta box? It might has some error when you declaring the fields.
September 14, 2018 at 4:14 PM #11344wkoehn
ParticipantSeptember 14, 2018 at 4:54 PM #11347Anh Tran
KeymasterI've just tried your code and it works without any bug shown. Does that happen for new posts? or old posts? Or you always see that bug no matter which page you're on?
September 14, 2018 at 5:03 PM #11348wkoehn
ParticipantAnh, what data type should I be using for the custom table storage?
MB_Custom_Table_API::create( 'hcr_location_meta', array( 'hcr_location_type' => 'TEXT NOT NULL', 'hcr_location_address' => 'TEXT NOT NULL', 'hcr_location_map' => '??????????', ) );September 14, 2018 at 5:08 PM #11349Anh Tran
KeymasterMap saves data as
latitude, longitude[, zoom], so it should be just text, e.g.TEXT NOT NULL.September 14, 2018 at 5:11 PM #11350wkoehn
ParticipantAnd yes it is happening on new posts and old. Only on pages that contain the metabox with geolocation however. I think it has something to do with the custom table storage. Let me test that theory.
September 14, 2018 at 5:16 PM #11351wkoehn
ParticipantIt still happens with custom table storage turned off and doublechecked to make sure it stored metadata in postmeta vs custom table.
September 18, 2018 at 5:43 PM #11381Anh Tran
KeymasterCan you share your code of that meta box? I tried to replicate the problem on my localhost, but everything seems work fine to me.
September 18, 2018 at 11:23 PM #11383wkoehn
ParticipantAnh, I'd gladly give you wp-admin access to that site if you want it. Not sure how to send a private message on here?
September 19, 2018 at 9:49 AM #11387Anh Tran
KeymasterPlease send me an email via contact form.
September 19, 2018 at 1:39 PM #11393wkoehn
ParticipantSent you a login. Do whatever you want. It's just a test site to evaluate if metabox/wordpress is a good platform for a simple app idea.
September 19, 2018 at 3:46 PM #11394Anh Tran
KeymasterHi, I fixed that bug weeks ago, but forgot to update the Geolocation extension. I've just updated the extension, please try again.
September 19, 2018 at 3:54 PM #11395wkoehn
ParticipantWorks great now! Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.