• Resolved kulturbrigad

    (@kulturbrigad)


    Hello,
    I just updated this plugin, and it made error 500.
    I had to switch off the plugin.
    Can you help me, why is that happened?
    Thanks,
    istvan

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter kulturbrigad

    (@kulturbrigad)

    this plugin generates fatal error:
    “Fatal error: Can’t use function return value in write context in /home/thsiubkw/public_html/wp-content/plugins/staff-directory/classes/staff-directory-shortcode.php on line 91”

    jeremyempie

    (@jeremyempie)

    Me too

    dmkjr

    (@dmkjr)

    Yeah, this release messed up a lot of things. I had to revert myself.

    -Shortcodes stopped working.
    -Script bled over to other custom_post_types making other things not function.
    -Removes template tags and basically strips CSS from page.

    GBCadmin

    (@gbcadmin)

    Same issue here. Restored from backup to recover.

    mandikaye

    (@mandikaye)

    My whole site went down with this update. Disabled the plugin by renaming the source folder and got everything back up and running – but I’d definitely like a working version of this restored.

    Thanks!

    daymobrew

    (@daymobrew)

    Same issue here.
    I reverted to 1.0.3.

    I am on PHP 5.4.45.

    https://stackoverflow.com/questions/1532693/weird-php-error-cant-use-function-return-value-in-write-context
    The issue seems to be because of the use of ’empty’, a “language construct” that can only take variables.
    The empty() documentation says to test for ‘false’ for pre-5.5 versions.
    https://php.net/manual/en/function.empty.php

    The solution that works for me is to change:
    if(!empty(self::photo_url_shortcode())){
    to
    if(self::photo_url_shortcode() == false){
    on line 91 of staff-directory/classes/staff-directory-shortcode.php

    I will submit a pull request on GitHub.

    daymobrew

    (@daymobrew)

    daymobrew

    (@daymobrew)

    I had a mistake in my code – I was checking for an empty string instead of a non-empty string.

    Adam has committed a change on GitHub
    https://github.com/adamtootle/staff-directory/blob/master/classes/staff-directory-shortcode.php

    He changed:
    if(!empty(self::photo_url_shortcode())){
    to:
    $photo_url = self::photo_url_shortcode();
    if(!empty($photo_url)){

    Jaap de Wit

    (@hitec4ever)

    Hi, I’ve changed the code according the github link. The plugin is working after that but creating or edditing posts and pages result in fatal error. (Divi theme).

    After disabling the staff directory plugin everything works again.

    Can the plugin be fixed? Latest version is also not working.

    daymobrew

    (@daymobrew)

    @japp: What is the error message?
    What version of PHP is your site on?

    Jaap de Wit

    (@hitec4ever)

    @daymobrew, it’s version PHP Version 5.3.29

    daymobrew

    (@daymobrew)

    What is the fatal error?
    Can you look at your server logs and copy the error messages here.

    One could argue that Divi is breaking the plugin ??

    RGW

    (@horburygoffe)

    I had this error and I commented out the section that was causing the problem, which seems to be to do with the photo. As I don’t use photos in my directory this isn’t important to me. For those that don’t know, to comment out you just add /* at the start and */ at the end.

    So add /* at the start of line 90 and */ at the end of line 96.

    I guess if you just wanted to get your site back online this would work but maybe the photos would disappear. Better than removing the whole directory if the directory is really important to your site.

    • This reply was modified 7 years, 11 months ago by RGW.
    Plugin Author adamtootle

    (@adamtootle)

    I released a fix for this tonight. Sorry guys.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Update – error 500’ is closed to new replies.