Bug #23788 See Comments

Error on creating new Grid field

Version: 4.3.6 Reporter: Melody

When creating a new Grid field there are now Grid-related options in the form. Once I click Save i get the following errors:

Warning
Invalid argument supplied for foreach()

ee/EllisLab/Addons/grid/ft.grid.php, line 594

    Severity: E_WARNING

Warning
Invalid argument supplied for foreach()

ee/EllisLab/Addons/grid/libraries/Grid_lib.php, line 704

    Severity: E_WARNING

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:119)

ee/legacy/core/Input.php, line 237

    Severity: E_WARNING

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:119)

ee/legacy/libraries/Functions.php, line 392

    Severity: E_WARNING

Afterward I can edit the new field and the Grid-related options are present.

  • I am unable to replicate on an unmodified installation. Do you have any add-ons installed, and are there any JavaScript errors present in your console?

    Derek Jones
    04th November, 2018 at 6:39pm
  • The cause seems to be a language-file, somehow. I currently use German. In English the error doesn’t happen.

    When selecting Grid in the field creation form, the resulting POST request to admin.php?/cp/fields/create returns

    Warning
    Invalid argument supplied for foreach()
    
    ee/EllisLab/Addons/grid/ft.grid.php, line 594
    
        Severity: E_WARNING
    
    Warning
    Invalid argument supplied for foreach()
    
    ee/EllisLab/Addons/grid/libraries/Grid_lib.php, line 704
    
        Severity: E_WARNING
    
    ["success"]

    which results in

    JSON.parse: unexpected character at line 2 column 1 of the JSON data

    I narrowed it down to admin_content_lang.php …

    Melody
    05th November, 2018 at 7:03am
  • Are you using the German language pack from GitHub? Here is the current admin_content_lang.php file.

    If you have verified that you have that, do these errors go away when you replace that one file with the admin_content_lang.php from the provided English language pack?

    Derek Jones
    05th November, 2018 at 8:50am
  • No, using that file the error occurs.

    If I replace it with the corresponding English language file there’s no error.

    Melody
    05th November, 2018 at 9:49am
  • Took me a bit to spot, but looks like the language pack author accidentally left some broken HTML tags in the options_field_desc field. I fixed it in the repo, you can grab a corrected version here

    Derek Jones
    05th November, 2018 at 10:14am
  • Almost 😊

    There’s one more missing less-than-sign on line 371.

    <b>Eins/b>

    That fixes it. Thanks.

    Melody
    05th November, 2018 at 4:41pm
  • Indeed it was, fixed, thanks!

    Derek Jones
    05th November, 2018 at 5:15pm

You must be signed in to comment on a bug report.

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

ExpressionEngine News!

#eecms, #events, #releases