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.

2.5.1 error with image channel field

May 30, 2012 12:29pm

Subscribe [10]
  • #1 / May 30, 2012 12:29pm

    mfraase

    79 posts

    Hi,

    I have a channel field called “image” designed to allow me to add a thumbnail image to an article.

    After updating to 2.5.1, I’m getting the following error (twice):

    A PHP Error was encountered
    Severity: Warning
    Message: Wrong parameter count for array_unique()
    Filename: libraries/EE_Javascript.php
    Line Number: 68

    And EE won’t let me add the image.

    Actually, I cleared the cookies and cache and I’m getting the same error twice when I click Content > Publish > [channel name].

  • #2 / May 30, 2012 8:22pm

    mfraase

    79 posts

    Really? Not even a “we’re looking into it.”

  • #3 / May 30, 2012 8:54pm

    Dan Decker

    7338 posts

    Hi mfraase,

    Really? Not even a “we’re looking into it.”

    We don’t work like that man. We want to offer you a possible solution with the first response, not placate your wait time 😊

    Did you make sure to update /themes as part of the update to 2.5.1? What version of ExpressionEngine did you update from? UI errors like this are usually the symptom of an out of date /themes folder

    I look forward to your reply!

    Cheers,

  • #4 / May 30, 2012 9:20pm

    mfraase

    79 posts

    Thanks for the response, Dan.

    Yes, I’ve updated /themes. And I’ve double-checked everything.

    Update was from 2.5.0 to 2.5.1.

    Going now to triple-check everything.

  • #5 / May 30, 2012 9:30pm

    Dan Decker

    7338 posts

    Hey Michael,

    Ok, so themes is out - is the field a standard file field? What is the process that produces the error for you? SInce this is 2.5.1 - I need to try to reproduce the problem if it’s a bug.

    Any third-party stuff involved?

    Cheers,

  • #6 / May 30, 2012 9:45pm

    mfraase

    79 posts

    HERE’S WHAT I DID:

    Re-installed all of the files from the 2.5.1 distribution (including /system/installer just to be safe).
    Pointed my browser at the control panel. It told me everything was updated.
    Went to Content > Publish > [channel_name].

    HERE’S WHAT I EXPECTED:

    The control panel to open so I can add an article.

    HERE’S WHAT HAPPENED:

    I received two instances of the following error:

    A PHP Error was encountered
    Severity: Warning
    Message: Wrong parameter count for array_unique()
    Filename: libraries/EE_Javascript.php
    Line Number: 68

    I’m unable to add an image to the draft article. My {image] field is a channel field in my “default” field group. Field settings type is “file” and field options file type is “image.”

    As others have noted below, I’m also getting the above error (but only a single instance of it) in the File Manager.

    I’m also suddenly getting a bunch of other PHP warnings all of a sudden that I can’t replicate just now.

    Update: Here’s a sampling of the PHP warnings; most are repeated at least twice:

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined variable: plugin_info
    Filename: models/addons_model.php
    Line Number: 145
    A PHP Error was encountered
    Severity: Warning
    Message: array_unique() [function.array-unique]: The argument should be an array
    Filename: models/addons_model.php
    Line Number: 145
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined variable: plugin_info
    Filename: models/addons_model.php
    Line Number: 183
    {/code]
    
    [code]
    A PHP Error was encountered
    Severity: Warning
    Message: array_unique() [function.array-unique]: The argument should be an array
    Filename: models/addons_model.php
    Line Number: 183

    And yes, there’s boat-loads of third-party stuff involved; I’ve tried turning off all of it that I can, with the same problem resulting.

    Let me know if you want me to provide you with an admin login.

  • #7 / May 30, 2012 10:44pm

    werxstudio

    12 posts

    I’m actually also getting this same error when going to File Manager after upgrading to 2.5.1

  • #8 / May 30, 2012 11:04pm

    Corazon

    2 posts

    Heya guys, just thought I’d add to the mix too. From 2.5.0 to 2.5.1, same PHP errors for me in File Manager and in addition when I try to create a new category for a channel (that could be just me however).
    (Matrix/Exp:resso Store/Freeform only 3rd party)

  • #9 / May 30, 2012 11:28pm

    werxstudio

    12 posts

    Tried creating a new category and also got the same error.

  • #10 / May 31, 2012 9:50am

    Oldboy

    2 posts

    HERE’S WHAT I DID:
    I’m unable to add an image to the draft article. My {image] field is a channel field in my “default” field group. Field settings type is “file” and field options file type is “image.”

    I report the same problems (and I think they are serious: angry customers 😊

  • #11 / May 31, 2012 4:50pm

    roadRUNN3R

    26 posts

    I’m experiencing the same PHP errors in the File Manager and other areas.

    Perhaps this thread could be merged with: http://ellislab.com/forums/viewthread/218293/

  • #12 / May 31, 2012 10:53pm

    werxstudio

    12 posts

    So nothing on this yet? Anyone have 2.5.0? I might need to roll back to that version since this is a live client site that I’m having issues with.

  • #13 / Jun 01, 2012 5:02am

    timoteus

    25 posts

    Hi!

    Well I looked into the EE_Javascript.php file at line 68 and the error says that the function array_unique() gets the wrong number of parameters.
    I’ve checked that, and found out that removing the optional sorting parameter seems to solve the problem.

    So changing

    if (is_array($val) && isset($current[$var_name]) && is_array($current[$var_name]))
      {
       $current[$var_name] = array_unique(array_merge($current[$var_name], $val), SORT_STRING);
      }

    into

    if (is_array($val) && isset($current[$var_name]) && is_array($current[$var_name]))
      {
       $current[$var_name] = array_unique(array_merge($current[$var_name], $val));
      }

    solves the issue for me.

    It doesn’t seem to be a problem, because SORT_STRING is the default sorting, so removing it may not cause a problem.

    Can anybody confirm the solution?

  • #14 / Jun 01, 2012 5:35am

    doubleplusgood

    199 posts

    I’m also getting the error just going to Design -> Templates -> Template Manager. I upgraded from 2.5.0.

    The fix by timoteus seems to resolve the bug for me.

  • #15 / Jun 01, 2012 6:06am

    Gnuus

    96 posts

    Thanks Timoteus, this solved the problem!

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

ExpressionEngine News!

#eecms, #events, #releases