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.

"Undefined Index" PHP Errors after upgrade from 1.6 to 2.9

August 17, 2014 6:50pm

Subscribe [1]
  • #1 / Aug 17, 2014 6:50pm

    gcylinder

    49 posts

    After upgrading from 1.6 to 2.9, I’m getting a set of the errors below when displaying a page containing images, one set for each image. I’m running PHP 5.4.x and it says “Fast CGI” after the 5.4.x.

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: upload_date
    Filename: file/ft.file.php
    Line Number: 303
    
    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: modified_date
    Filename: file/ft.file.php
    Line Number: 304

    I also had Mark Huot’s File extension running in 1.6. I “resubmitted” or updated the field type for one custom field as “File” and I also ran the fix in this thread on this one custom file field, but only the part regarding the line breaks:

    https://ellislab.com/forums/viewthread/218268/

    and to see those in my template, I have to use the tag pair, or else nothing is output:

    {myFileFieldName}{url}{/myFileFieldName}

    I didn’t run the part about including the file directory, because EE is not parsing my {filedir_x} tag.

    In all other cases of file fields, where I didn’t run the fix or update/resubmit the custom field type as File, I can get output by just using the stand-alone tag, but I still get the errors:

    {myFileFieldName}
  • #2 / Aug 18, 2014 6:45pm

    gcylinder

    49 posts

    It’s weird: this error/warning is taking place at lines 303 and 304 of expressionengine/fieldtypes/file/ft.file.php in a function called:

    replace_tag($file_info, $params = array(), $tagdata = FALSE)

    and here’s where it chokes in that function:

    $date_vars = array(
       'upload_date' => $file_info['upload_date'],
       'modified_date' => $file_info['modified_date']
    );

    I know next to nothing about PHP, but I reckon $file_info has a problem, so I did an echo on $file_info and it returns what looks like just a string: “Array”. The upload_date and modified_date columns in exp_files table are filled with data, so I can’t imagine what’s up.

  • #3 / Aug 19, 2014 2:54pm

    gcylinder

    49 posts

    I had to do two things to resolve the issue:

    Apply both steps (adding the {filedir_x} and searching replacing new lines/line breaks) of the fix from this EllisLab forum thread across the board, to all File fields not just to one File field: https://ellislab.com/forums/viewthread/218268/

    I went into the Admin for channel fields and re-submitted each custom field that was a File field type.

    Something about that exercise appears to have fixed the issue. Hope this helps someone else.

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

ExpressionEngine News!

#eecms, #events, #releases