Warning: Cannot use a scalar value as an array

Support MB Geolocation Warning: Cannot use a scalar value as an arrayResolved

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #11338
    wkoehnwkoehn
    Participant

    Any 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

    #11341
    wkoehnwkoehn
    Participant

    I'm using custom tables, maybe that has something to do with it?

    #11343
    Anh TranAnh Tran
    Keymaster

    Hi, can you post the code of your meta box? It might has some error when you declaring the fields.

    #11344
    wkoehnwkoehn
    Participant

    https://ghostbin.com/paste/n3eyc

    #11347
    Anh TranAnh Tran
    Keymaster

    I'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?

    #11348
    wkoehnwkoehn
    Participant

    Anh, 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'   => '??????????',
    ) );
    
    #11349
    Anh TranAnh Tran
    Keymaster

    Map saves data as latitude, longitude[, zoom], so it should be just text, e.g. TEXT NOT NULL.

    #11350
    wkoehnwkoehn
    Participant

    And 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.

    #11351
    wkoehnwkoehn
    Participant

    It still happens with custom table storage turned off and doublechecked to make sure it stored metadata in postmeta vs custom table.

    #11381
    Anh TranAnh Tran
    Keymaster

    Can you share your code of that meta box? I tried to replicate the problem on my localhost, but everything seems work fine to me.

    #11383
    wkoehnwkoehn
    Participant

    Anh, 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?

    #11387
    Anh TranAnh Tran
    Keymaster

    Please send me an email via contact form.

    #11393
    wkoehnwkoehn
    Participant

    Sent 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.

    #11394
    Anh TranAnh Tran
    Keymaster

    Hi, I fixed that bug weeks ago, but forgot to update the Geolocation extension. I've just updated the extension, please try again.

    #11395
    wkoehnwkoehn
    Participant

    Works great now! Thanks!

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.