Support » Plugin: LifterLMS » Error when updating to 3.16.5

  • Resolved przembar

    (@przembar)


    First of all I need to point out that I did not created quizzes so I do not have them 🙂

    After upgrade my WP died returning only 500 🙁
    I’ve disabled plugin via db. Ok – back to normal.

    Then when I tried switch on Lifter form plugin manager then I got error (path partially anonymised):

    Fatal error: Can’t use method return value in write context in /****/****/wp-content/plugins/lifterlms/includes/models/model.llms.question.php on line 406

    So I modified file:

    	public function has_image() {
    // 		$img = $this->get( 'image' );
    // 		if ( is_array( $img ) ) {
    // 			if ( ! empty( $img['enabled'] ) && ( ! empty( $img['id'] ) || ! empty( $img['src'] ) ) ) {
    // 				return ( 'yes' === $img['enabled'] );
    // 			}
    // 		}
     		return false;
    	}
    
    	/**
    	 * Determine if a featured video is enabled & not empty
    	 * @return   bool
    	 * @since    3.16.0
    	 * @version  3.16.0
    	 */
    	public function has_video() {
     //		return ( 'yes' === $this->get( 'video_enabled' ) && ! empty( $this->get( 'video_src' ) ) );
           return false;
    	}
    
    	/**
    	 * Access question manager (used for question groups)
    	 * @todo     need to prevent access for non-group questions...
    	 * @return   obj
    	 * @since    3.16.0
    	 * @version  3.16.0
    	 */

    And it started – ok
    Then I migrated DB – it passed.

    What to do with this changes? Backup succeeded but should I care about this code modification?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Not full code added – sorry for that

    	public function has_description() {
    		//return ( 'yes' === $this->get( 'description_enabled' ) && ! empty( $this->get( 'content' ) ) );
    		return true;
    	}
    
    	/**
    	 * Determine if a featured image is enabled and not empty
    	 * @return   bool
    	 * @since    3.16.0
    	 * @version  3.16.0
    	 */
    	public function has_image() {
    // 		$img = $this->get( 'image' );
    // 		if ( is_array( $img ) ) {
    // 			if ( ! empty( $img['enabled'] ) && ( ! empty( $img['id'] ) || ! empty( $img['src'] ) ) ) {
    // 				return ( 'yes' === $img['enabled'] );
    // 			}
    // 		}
     		return false;
    	}
    
    	/**
    	 * Determine if a featured video is enabled & not empty
    	 * @return   bool
    	 * @since    3.16.0
    	 * @version  3.16.0
    	 */
    	public function has_video() {
     //		return ( 'yes' === $this->get( 'video_enabled' ) && ! empty( $this->get( 'video_src' ) ) );
           return false;
    	}
    Plugin Author Thomas Patrick Levy

    (@thomasplevy)

    @przembar,

    Sorry for this issue. However, it’s not something we’ll be fixing as LifterLMS supports PHP 5.6 or higher. This error is evidence that your server is currently running PHP 5.4 or lower which has reached it’s official end of life (http://php.net/eol.php)

    To resolve this error please contact your webhost and ask them to upgrade you to PHP 5.6 or later. I’d recommend jumping to 7 or 7.1 if able.

    Best,

    @thomasplevy
    I’ve updated to PHP7 – lifter starting without my code changes THANKS 🙂

    One question is (I expect answer no – but I need to make myself sure) – is those functions were important from DB update procedure, should I do anything since I have now Lifter code without changes?

    Plugin Author Thomas Patrick Levy

    (@thomasplevy)

    The functions that you commented out to make the DB proceed?

    No, they weren’t necessary to the DB upgrade. Additionally, if you didn’t have any quizzes before the migration then the migration didn’t actually matter for you anyway!

    Best,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when updating to 3.16.5’ is closed to new replies.