Custom Fields
Re-Envisioned
Support Meta Box Geolocation Warning: Cannot use a scalar value as an array

  • Creator
    Topic
  • #11338
    Resolved wkoehn
    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

Viewing 10 replies - 1 through 10 (of 14 total)
  • Author
    Replies
  • #11341
    wkoehn
    Participant

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

    #11343
    Anh Tran
    Keymaster

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

    #11344
    wkoehn
    Participant
    #11347
    Anh 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
    wkoehn
    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 Tran
    Keymaster

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

    #11350
    wkoehn
    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
    wkoehn
    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 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
    wkoehn
    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?

Viewing 10 replies - 1 through 10 (of 14 total)
  • You must be logged in to reply to this topic.