Author Topic: 2.10.0 Methods with the same name as their class will not be constructors in a f  (Read 628 times)

Offline Hans

  • Posts: 908
  • Gender: Male
Hello,

In found this in PHP_error log:
Quote
2017-04-03T09:23:26+00:00 [E_DEPRECATED] /admin/media/resize_img.php:[29] from /admin/media/upload.php:[21] include_once "Methods with the same name as their class will not be constructors in a future version of PHP; RESIZEIMAGE has a deprecated constructor"

I suppose it's only a warning message but would like to know what it means and how it could eventually have impact on a site (eg if in future PHP would be upgraded (now 7.0))
(How) can I get rid of it?

Thank you!
Hans - Nijmegen - The Netherlands

Offline jacobi22

  • Global Moderator
  • *****
  • Posts: 4671
  • Gender: Male
    • Jacobi22
confirmed   (Y)

we work on it
i've no solution at the moment, but the message in the error-log is not displayed, if you use a error-level in wb-advanced options (not E_NONE)

Es bist immer nur Du, auch wenn du mich vergisst, es gibt niemanden, der mir näher ist
Immer nur du, die mich wach hält
(*miss you*)

Offline DarkViper

  • Core Development
  • *****
  • Posts: 2894
  • Gender: Female
its easy to fix:

simply exchange Line 47 of /admin/media/resize_img.php

function RESIZEIMAGE($imgFile="")
with
public function __construct($imgFile "")

(its one of the old PHP-4 classes... where the constructor had the same name like the class)
« Last Edit: April 04, 2017, 01:05:49 PM by DarkViper »
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are ... but you can not leave them like that !!" :-P
Ein einziger Buchstabendreher kann einen ganzen Satz urinieren.

Offline Hans

  • Posts: 908
  • Gender: Male
Thanks both of you  (Y)
Hans - Nijmegen - The Netherlands

Offline dbs

  • Betatester
  • **
  • Posts: 6980
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Code:
Only registered users can see contents. Please click here to Register or Login.Thanks for this. I was able with this to fix something in wblib and LibraryAdmin.  (Y)

Offline dbs

  • Betatester
  • **
  • Posts: 6980
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Nachfrage. (WB2.10.1, PHP7.0.20)
Im Modul Feedback in class.feedback.php Zeile 1093 ff
Code:
Only registered users can see contents. Please click here to Register or Login.
Wenn man hier also daraus macht:
Code:
Only registered users can see contents. Please click here to Register or Login.
Führt das im Frontend zu
Code:
Only registered users can see contents. Please click here to Register or Login.1109 = $this->page_id = $page_id;
Was wäre hier zu tun? :)

Backend das Gleiche, nur andere Zeilennummer (665) und geht um $this->section_id = $section_id;.
« Last Edit: June 18, 2017, 08:44:56 AM by dbs »

Offline dbs

  • Betatester
  • **
  • Posts: 6980
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Lösung, dank Manu.

Wenn die Klasse so aussieht, also mit extends drin:
Code:
Only registered users can see contents. Please click here to Register or Login.dann unter der bereits ersetzten Zeile public function __construct( noch hinzufügen:
Code:
Only registered users can see contents. Please click here to Register or Login.und etwas tiefer, die Zeile wo die erweiterte/extends Klasse aufgerufen wird, entfernen:
Code:
Only registered users can see contents. Please click here to Register or Login.
konkretes Beispiel aus feedback
Code:
Only registered users can see contents. Please click here to Register or Login.
Das schreib ich wohl mehr für mich zum später reinschauen so auf :-)