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.

Checking if user has specified uploaded file

February 17, 2012 10:07am

Subscribe [2]
  • #1 / Feb 17, 2012 10:07am

    CIB

    5 posts

    Hi,

    In my template I have this code:

    {page_image}{path}_page_resize/{filename}.{extension}{/page_image}

    This works fine when an image has been specified in the entry.

    However if the user has not uploaded/specified an image, then I get this PHP error:

    A PHP Error was encountered
    Severity: Warning
    Message: array_merge(): Argument #1 is not an array
    Filename: libraries/Functions.php
    Line Number: 2587

    Is there something I can do like:

    {if {page_image} != ''}
    {page_image}{path}_page_resize/{filename}.{extension}{/page_image}
    {/if}

    ?

    If I try the above approach I get a PHP eval error:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/dadadada/system/expressionengine/libraries/Functions.php(659) : eval()'d code on line 13
  • #2 / Feb 17, 2012 11:14am

    CIB

    5 posts

    Turns out this is a known issue in 2.4.0.

    https://support.ellislab.com/bugs/detail/17450

  • #3 / Feb 18, 2012 1:02pm

    Dan Decker

    7338 posts

    Hi CIB,

    I’m sorry you were bitten by that bug. Thanks for posting the link here for others.

    Be sure to leave a comment on the bug report so that you will be notified of progress.

    Is there anything else we can assist you with?

    Cheers,

  • #4 / Feb 20, 2012 8:24am

    CIB

    5 posts

    No problem Dan, thanks for your response. I have temporarily resolved the issue by applying the solution as listed in the ticket but will keep an eye out for when the fix is released in an upcoming version.

    Thanks again,

    Danny : CIB

  • #5 / Feb 24, 2012 10:34am

    Shane Eckert

    7174 posts

    Hello CIB,

    I am glad to hear you have a solution for now. Nice work finding the bug.

    Thank you for posting your question here on the ExpressionEngine forums.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases