Validate class: scope errors in PHP Editor 1.7.0

Validate class: scope errors in PHP Editor 1.7.0

irisdevirisdev Posts: 2Questions: 1Answers: 0
edited January 2018 in Editor

While upgrading my project to editor 1.7.0, using the following method:

        Field::inst( 'rooms.room_num' )
            ->validator( Validate::minMaxNum(1,999,'.', ValidateOptions::inst()
                    ->message( 'This field must be a number between 1 and 999' )) ) 

I had the following error:
Fatal error: Cannot access self:: when no class scope is active in ..../Editor-1.7.0/php/Editor/Validate.php on line 548

Changing all instances of self:: with Validate:: in that file, the problem seems to be solved but I haven't had the time to check if everything is ok. Has anyone else noticed these errors?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Answer ✓

    Hi,

    Thanks for letting me know about this. The ability to use self:: in a static function was introduced in PHP 5.4. From that, I'm presuming that you are using 5.3? The libraries should be compatible with 5.3, so this is something that I will correct (in fact have just committed the fix for) and it will be in 1.7.1 which is out later this week.

    Thanks,
    Allan

  • irisdevirisdev Posts: 2Questions: 1Answers: 0

    Hi Allan, thanks for the reply.
    Yes for this project I'm using php 5.3

This discussion has been closed.