Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#6721 closed enhancement (fixed)

Remove PHP4 Constructor backcompat method from BP_Groups_Widget class

Reported by: tw2113 Owned by: boonebgorges
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: Groups Keywords: good-first-bug needs-patch commit
Cc: brajesh@…

Description

Not sure we need this any more.

/**
 * PHP4 constructor
 *
 * For backward compatibility only
 */
function bp_groups_widget() {
	$this->_construct();
}

Plus not seeing the _construct() method in the class anyway.

Attachments (1)

6721.patch (6.2 KB) - added by sbrajesh 5 years ago.
Remove php4 constructor and cleanup the code a little bit

Download all attachments as: .zip

Change History (10)

#1 @boonebgorges
5 years ago

  • Component changed from API to Component - Groups
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.5

Plus not seeing the _construct() method in the class anyway.

https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups/bp-groups-widgets.php?marks=21-32#L20

But yes, we can remove the PHP4 constructor.

#2 @tw2113
5 years ago

Not arguing at all, but does it end up matching up with the single underscore vs double underscore? May be learning something new here myself.

#3 @boonebgorges
5 years ago

Ah, I didn't notice the single underscore. https://buddypress.trac.wordpress.org/changeset/4211 I'm not sure whether WP required PHP 5 at this time - if so, the groups widget would've thrown a fatal error on PHP4. So yeah, let's rip it out.

Easy props for a first-time contributor.

#4 @sbrajesh
5 years ago

  • Cc brajesh@… added

It has been 8 weeks without any new patch, so here I am putting one.
The patch removes php4 style constructor and also cleans up the code to follow WP Coding standards.

@sbrajesh
5 years ago

Remove php4 constructor and cleanup the code a little bit

#5 @DJPaul
5 years ago

  • Keywords commit added

Thanks @sbrajesh. We'll commit this in two parts.

#6 @sbrajesh
5 years ago

Thank you @DJPaul
Please do let me know if you want me to put it as 2 different patches.

#7 @boonebgorges
5 years ago

In 10440:

Remove PHP4-style constructor from BP_Groups_Widget.

The constructor is no longer needed, and contains a typo that would cause a
fatal error if it were ever called.

Props sbrajesh, tw2113.
See #6721.

#8 @boonebgorges
5 years ago

In 10441:

Improved coding standards in BP_Groups_Widget.

Props sbrajesh.
See #6721.

#9 @boonebgorges
5 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 10442:

Use selected() when building BP_Groups_Widget markup.

Props sbrajesh.
Fixes #6721.

Note: See TracTickets for help on using tickets.