JComments errors in PHP 7: plgContentJComments and JCommentsACL

What?
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 25
Fix:
// 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 17
Fix:
// 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 14
Fix:
// change on line 23
function JCommentsSubscriptionManager()
// to
function __construct()

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.