WeBid 1.2 error in admin regarding Methods and Constructors

Discussion in 'General Support' started by nay27uk, May 31, 2016.

  1. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    In WeBid 1.2 on a PHP7 server we get this error in the WeBid admin error log about a Method and Constructor

    Bug Report can be found on the Bug Tracker HERE
     
    Last edited: May 31, 2016
  2. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    Thanks for adding the fix to the bug tracker tim
     
  3. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    I am unsure if this is already fixed by tim on the github but this problem is also on
    Functions_global.php and class_fees.php

    Code:
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; global_class has a deprecated constructor in /home/auctions/public_html/webidnew/WeBid/includes/functions_global.php on line 17
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; fees has a deprecated constructor in /home/auctions/public_html/webidnew/WeBid/includes/class_fees.php on line 17
    
     
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    Fixed PR sent
     
    Last edited: Jun 3, 2016
  5. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,107
    Likes Received:
    235
    According to the PHP manual for the PHP 5, the class and the function can't have the same name in the latest php version. This is what it says:

    http://php.net/manual/en/migration70.deprecated.php
    PHP 4 style constructors (methods that have the same name as the class they are defined in) are deprecated, and will be removed in the future. PHP 7 will emit E_DEPRECATED if a PHP 4 constructor is the only constructor defined within a class. Classes that implement a __construct()method are unaffected.

    • In the functions_global we have class global_class & function global_class()
    • In class_fees we have class fees & function fees
    I would have to look more into this but, I am sure there are going to a lot more pages like this that we will have to fix so, it works with the latest php version.
     
  6. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    Its fixed david a pull request PR has already been sent to github with the fixed files.
    I am keeping my eyes out for any more as well but up to now it was just the three
     
  7. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,107
    Likes Received:
    235
    oh ok. I didn't understand what you meant when you said Fixed PR sent. Now I understand your message. What does PR stand for? Problem.
     
  8. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,107
    Likes Received:
    235
    I think I found another one. I see similar code here:
    In the includes/diff/diff.php file it has:

    function diff_op_add
    class diff_op_add
     
  9. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,560
    Likes Received:
    542
    Yeah just change any function some class name() to function __construct() in any files you find and then submit a PR (Pull Request) to renloks github WeBid from your own github WeBid fork
     

Share This Page