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.

Can EE not handle query strings with arrays inside arrays? (i.e. a standard GET checkbox implementation)

October 10, 2013 10:30pm

Subscribe [1]
  • #1 / Oct 10, 2013 10:30pm

    96black

    26 posts

    Hey guys,
    On one of the sites I’m working on there’s a custom php search form I’ve written, and part of it has a list of categories on the side which are checkboxes.

    So naturally they all share the name=“category[]” property so that they’re accessible as an array. Nothing crazy going on there.

    Yet the resulting GET query string like below results in the following sorts of php errors.

    (i.e. “/resources/search?keywords=test&categories;[]=109”)

    (the forum is replacing the percent5B percent5D special chars in the above).

    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Template.php
    Line Number: 322

    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Template.php
    Line Number: 326

    A PHP Error was encountered
    Severity: Notice
    Message: Array to string conversion
    Filename: libraries/Template.php
    Line Number: 322
    A PHP Error was encountered
    Severity: Notice

    If you look in the Template library you can see it’s freaking out when the ee()->config->_global_vars are being processed… it seems like it doesn’t support this functionality?

    I’m not missing something am I? Has anyone else got something like this working?

  • #2 / Oct 10, 2013 10:41pm

    96black

    26 posts

    Hmm I’ve seen it elsewhere in some safecracker implementations (I’m not using safecracker). So it has to be able to support it.

    For the record I’m using EE2.6.1 in this instance.

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

ExpressionEngine News!

#eecms, #events, #releases