Skip to content

CIVIMM-444: Hide membership tab on contribution page settings#11

Merged
erawat merged 1 commit intomasterfrom
CIVIMM-444-hide-membership-tab
Jan 28, 2026
Merged

CIVIMM-444: Hide membership tab on contribution page settings#11
erawat merged 1 commit intomasterfrom
CIVIMM-444-hide-membership-tab

Conversation

@erawat
Copy link
Member

@erawat erawat commented Jan 27, 2026

Overview

Hides the "Memberships" tab/link on all CiviCRM contribution page admin settings as we do not support membeship signup with the contribution form.

This lives in PaymentProcessingCore (not Stripe) because hiding membership configuration is generic platform behavior — it applies regardless of which payment processor is active. PaymentProcessingCore is the shared extension for cross-processor platform logic.

Before

Contribution page settings show a "Memberships" tab in the tab bar and a "Membership Settings" link in the per-page configure dropdown.

After

Both the tab and the configure action link are removed.

Screenshot 2026-01-27 at 14 36 37 Screenshot 2026-01-27 at 14 36 46

Technical Details

  • New hook handler: Civi\Paymentprocessingcore\Hook\TabSet\ContributionPageTabs
    • Listens for civicrm/admin/contribute tabset
    • Removes string-keyed membership tab (from TabHeader::process())
    • Removes integer-keyed action link with uniqueName === 'membership' (from ContributionPage::configureActionLinks())
  • Registered via paymentprocessingcore_civicrm_tabset() in paymentprocessingcore.php

Core overrides

None.

Comments

4 unit tests: tab removal, action link removal, other tabsets unaffected, missing membership key handled gracefully.

@gemini-code-assist
Copy link

Summary of Changes

Hello @erawat, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience within CiviCRM by removing irrelevant "Memberships" options from the contribution page settings. Since membership integration is not supported on these pages, hiding these UI elements prevents confusion and simplifies the configuration process for administrators.

Highlights

  • UI Simplification: The "Memberships" tab and its corresponding action link have been removed from all CiviCRM contribution page administration settings to streamline the user interface.
  • New Hook Handler: A new PHP class, Civi\Paymentprocessingcore\Hook\TabSet\ContributionPageTabs, has been introduced to manage the removal of the membership tab and action link.
  • Hook Integration: The new hook handler is registered and invoked through the paymentprocessingcore_civicrm_tabset() function, ensuring it applies to the correct CiviCRM tabset.
  • Robust Testing: Comprehensive unit tests have been added to verify the correct removal of the membership tab and action link, ensure other tabsets are unaffected, and confirm graceful handling of cases where the membership key is absent.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a clean and effective solution to hide the 'Memberships' tab from CiviCRM contribution page settings. The new ContributionPageTabs class is well-designed to handle the two different contexts where the tabs are rendered. The changes are backed by a comprehensive set of unit tests, ensuring the functionality is robust and doesn't introduce regressions. The implementation in paymentprocessingcore_civicrm_tabset is extensible. I have one suggestion to make the code in ContributionPageTabs slightly more concise using a more functional style.

@erawat erawat merged commit 6796084 into master Jan 28, 2026
3 checks passed
@erawat erawat deleted the CIVIMM-444-hide-membership-tab branch January 28, 2026 07:53
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.

2 participants