During a site upgrade, the commenting extension for Joomla called JComments would return errors when using PHP version 7. This is a quick article to document what needed doing to fix the errors.
How?
First some errors:
ERROR: plgContentJComments
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJComments has a deprecated constructor in /plugins/content/jcomments/jcomments.php on line 25Fix:
// change on line 27 function plgContentJComments(&$subject, $config) // to function __construct(&$subject, $config)
- // change on line 27
- function plgContentJComments(&$subject, $config)
- // to
- function __construct(&$subject, $config)
ERROR: JCommentsACL
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsACL has a deprecated constructor in /components/com_jcomments/classes/acl.php on line 17Fix:
// change on line 41 function JCommentsACL() // to function __construct()
- // change on line 41
- function JCommentsACL()
- // to
- function __construct()
ERROR: JCommentsSubscriptionManager
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsSubscriptionManager has a deprecated constructor in /components/com_jcomments//jcomments.subscription.php on line 14Fix:
// change on line 23 function JCommentsSubscriptionManager() // to function __construct()
- // change on line 23
- function JCommentsSubscriptionManager()
- // to
- function __construct()