getk2 / k2

K2 - the powerful content extension for Joomla
https://getk2.org
GNU General Public License v3.0
135 stars 96 forks source link

PHP7 Warnings #293

Closed solracsf closed 8 years ago

solracsf commented 8 years ago

When adding/editing a Menu (K2 Categories Listing):

Warning: Declaration of K2Element::render() should be compatible with JFormField::render($layoutId, $data = Array) in /administrator/components/com_k2/elements/base.php on line 24

Some similar warnings on the Frontend of type

K2Element::render() should be compatible with JFormField::render($layoutId, $data = Array)

No issues/warnings on PHP 5.6.

fevangelou commented 8 years ago

Add this as well: http://www.joomlaworks.net/forum/k2-en/45109-php-7-warning-calendar-has-a-deprecated-constructor

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP;
Calendar has a deprecated constructor in /public_html/modules/mod_k2_tools/includes/calendarClass.php on line 32
kavadas commented 8 years ago

@acs-ferreira

Both issues have been fixed with:

https://github.com/getk2/k2/commit/5a9ae0a44b12d2e224b7f0dee3541d74c68b860d https://github.com/getk2/k2/commit/5dc22b8b4e3b255b8f346cde4b2d463a14c18919

Please use the development version and verify that it works.

solracsf commented 8 years ago

Can't confirm for CALENDAR as i'm not using it.

The only WARNINGS (not errors) i can seen now are:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgSystemK2Filter has a deprecated constructor in public/plugins/system/k2filter/k2filter.php on line 15

This on also trigger this one:

Warning: Cannot modify header information - headers already sent by (output started at /public/plugins/system/k2filter/k2filter.php:15) in /public/libraries/joomla/input/cookie.php on line 94

Then these ones on other pages:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON has a deprecated constructor in /srv/users/serverpilot/apps/dev/public/administrator/components/com_k2/lib/JSON.php on line 127
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor in /public/administrator/components/com_k2/lib/JSON.php on line 794
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor in /public/administrator/components/com_k2/lib/JSON.php on line 806
kavadas commented 8 years ago

The first two are not coming from K2 files.

The rest of them are fixed now with this https://github.com/getk2/k2/commit/65979d44bf68c1b4322525786c99e9f01d76687c .

solracsf commented 8 years ago

OK thanks.

I'll confirm https://github.com/getk2/k2/commit/65979d44bf68c1b4322525786c99e9f01d76687c later.

solracsf commented 8 years ago

https://github.com/getk2/k2/commit/65979d44bf68c1b4322525786c99e9f01d76687c is OK.

I've tested it with https://github.com/sstalle/php7cc and no errors had been stated, but some warnings.

This should be performed and fixed in the whole component.

fevangelou commented 8 years ago

More reported in the AllVideos issue tracker:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON has a deprecated constructor /administrator/components/com_k2/lib/JSON.php on line 127

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Services_JSON_Error has a deprecated constructor in //administrator/components/com_k2/lib/JSON.php on line 794

/cc @kavadas

solracsf commented 8 years ago

@fevangelou Those should be fixed already with https://github.com/getk2/k2/commit/65979d44bf68c1b4322525786c99e9f01d76687c cc @kavadas

kavadas commented 8 years ago

I am closing this issue since all reported errors should have been fixed with the latest commits.