File Gallery
[resolved] Call-time pass-by-reference has been removed in PHP 5.4 (6 posts)

  1. kraterdesign
    Posted 4 years ago #


    I upgraded PHP the other day from v5.3 to v5.4.3 and my WP site would no longer load (blank/white screen).

    The php error log had this to say:
    PHP Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of do_action(). in /[...]/wp/wp-content/plugins/file-gallery/includes/attachments.php on line 710

    Whenever you need to pass an argument by reference, just wrap it in an array, like so:
    do_action('file_gallery_delete_all_attachment_copies', $attachment_id, array(&$copies));

    And fix for same error on line 761 of same file:
    do_action('file_gallery_promote_first_attachment_copy', $attachment_id, array(&$promoted_id));

    PS. this has been proper way of pass-by-ref for a long time now, see:

    Using File-Gallery v1.7.4.1

  2. Mridul Gupta
    Posted 4 years ago #

    You have no idea how much trouble you saved me! I created a login just to thank you! I was having the exact same issue and was going nuts.. Resolved now, whew!!

  3. craig-mac
    Posted 4 years ago #

    Thanks! Huge help.

  4. Aesqe
    Plugin Author

    Posted 4 years ago #

    @everybody: it will be fixed in v1.7.5 of the plugin, coming soon.

    sorry I haven't updated it yet, but my free time has been non-existent for a while now. I'll try to release it this weekend.

  5. Aesqe
    Plugin Author

    Posted 4 years ago #

    @all: please test with File Gallery v1.7.5, the problem should be fixed now.


  6. kraterdesign
    Posted 4 years ago #

    Confirmed fixed, thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • File Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic