• Resolved hcolf

    (@hcolf)


    Upgraded Staff directory from 1.0.3 to 1.1.1 and it brought my web site down.

    Fatal error: Can’t use function return value in write context in /home3/mghcorg/public_html/wp-content/plugins/staff-directory/classes/staff-directory-shortcode.php on line 91.

    The function:
    static function photo_shortcode(){
    if(!empty(self::photo_url_shortcode())){
    return ‘‘;
    } else {
    return “”;
    }
    }

    is causing the error. Changed it to below and my site is working again. However, I know this is not the intent of the function. Please send correct code.

    static function photo_shortcode(){

    return ‘‘;

    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Having the same issue here after upgrade. Please fix asap. Reverted to 1.0.3 for the moment.

    Change the code for:

    static function photo_shortcode(){
    	$imagepath = self::photo_url_shortcode();
            if( !empty( $imagepath ) ){
                return '<img src="' . self::photo_url_shortcode() . '" />';
            } else {
                return "";
            }
        }

    The problem is that you cannot use the return value of the photo_url_shortcode method as the argument for the empty function in older versions of PHP. Newer versions allow that. By assigning the return value to a variable, you make this code work with older PHP versions.

    Thread Starter hcolf

    (@hcolf)

    Thank you. That resolved the issue.

    Plugin Author adamtootle

    (@adamtootle)

    I released a fix for this tonight. Sorry guys.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Version 1.1.1 fatal error’ is closed to new replies.