rtCamp / rtMedia

rtMedia (formerly Buddypress Media) adds advanced multimedia functionality to WordPress, BuddyPress and bbPress
https://rtmedia.io/
122 stars 110 forks source link

PHP 8 Compatibility issue #1942

Closed thebengalboy closed 1 year ago

thebengalboy commented 2 years ago

Description When you are running with PHP 8.0 or higher, the media tab disappears, it is not showing inside groups options. This happens with PHP 8.0 or higher and switching it back to PHP 7.4, the media tab comes back.

Possible problem As found by a user, probably the issue is in the file /app/main/controllers/template/RTMediaNav.php. There is a function that registers the menu called bp_core_new_subnav_item

The code doesn’t reach this function because of the following check: if (isset($bp->version) && $bp->version > '2.5.3')

The comparison operators might have changed in PHP 8, so the check here returns true in PHP 7.4, but it returns false in PHP 8, and that causes the error.

Reference issue reported: https://wordpress.org/support/topic/media-tab-not-showing-in-groups/

Pradeep1308 commented 2 years ago

The issue mentioned above will solve by changing the condition if (isset($bp->version) && $bp->version > '2.5.3') and using version_compare function . For this estimation will be ~2hr.

After this will start with a compatibility test with PHP 8 for core and Premium The estimation will be ~5hr

pooja-muchandikar commented 2 years ago

Ok @Pradeep1308 go ahead and start working on it..

Pradeep1308 commented 2 years ago

Here is the PR for the above issue for the media tab in the group. I've tested Core and Premium with PHP 8 and everything works fine, there was a bug in the error log but the above PR resolves that bug. cc: @pooja-muchandikar

pooja-muchandikar commented 2 years ago

Have you made the changes as per the issue description?

Please start thread on channel and get the PR reviewed by Rabiul..

Pradeep1308 commented 2 years ago

Yes, I've used the version compare function as mentioned in the issue.

pavanpatil1 commented 2 years ago

Update

tested both the core and premium plugin. Core plugin is working fine and in premium observed one issue with the BuddyPress media control feature. Added here. Rest working fine.

@Pradeep1308 please check this issue in premium when time permits and merge this PR

cc: @pooja-muchandikar

pavanpatil1 commented 1 year ago

Adding this issue to the next milestone as need to check the plugin with the latest version of PHP. Hence adding this in next milestone.

pavanpatil1 commented 1 year ago

Fixed and released in v4.6.13