Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #115: Resolve undefined 'link_class' warning for group join button #120

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

anas-ha
Copy link

@anas-ha anas-ha commented Oct 23, 2024

All Submissions:

Changes proposed in this Pull Request:

This PR fixes an issue where a warning (Undefined array key "link_class") is triggered in BuddyBoss groups, caused by the absence of the "link_class" key in PHP 8+. The fix uses a null coalescing operator (??) to provide a default empty value, preventing the warning and maintaining compatibility.

Additionally, the order of conditions within the if statement in the callback function of 'bp_get_group_join_button' (pmpro_bp_disable_group_buttons) was corrected, and parentheses were added to ensure the correct evaluation of conditions. The updated condition checks if the user can join the group first before evaluating the presence and value of $button_args['id'], enhancing both readability and accuracy.

How to test the changes in this Pull Request:

  1. Set up a BuddyBoss group with the Paid Memberships Pro and Paid Memberships Pro - BuddyPress and BuddyBoss Integration.
  2. Navigate to the group.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Fixes PHP 8+ warning for undefined array key "link_class" in the group join button when group joining is restricted. Adjusted the condition order and added parentheses for clarity and correctness in evaluating conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant