-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Display Custom Fields on ContributionPage settings #31487
base: master
Are you sure you want to change the base?
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
da528cb
to
75969c5
Compare
Looks good. Putting merge-ready just because it's not clear if it's intentional/out-of-scope that it doesn't work with subtypes, e.g. a custom group that is only for ContributionPages with financial type Donation. You can define such a custom group, but then it doesn't display here. I think it's ok for this if it's out-of-scope. Test fails are also happening elsewhere. |
Whilst I agree with this work, I think that we may want to think about some kind of upgrade step for people with this extension https://lab.civicrm.org/extensions/contributionpagecustomfield |
Just to clarify the extension I was referring to above currently handles the ability to have custom fields on contribution pages and also displays them. So if we merge this then people upgrading would probably end up possibly with the custom data displaying twice right? So I was thinking we could essentially pull this option value into core https://lab.civicrm.org/extensions/contributionpagecustomfield/-/blob/master/contributionpagecustomfield.php?ref_type=heads#L42 and then effectively deprecate that whole extension at that point and have an upgrade message of like "We see that you had the Contribution Page Custom Field extension enabled, this has now been disabled as it is now incorporated in core or similar" |
@seamuslee001 actually that wheel has already been invented :) |
@demeritcowboy Thanks - It's kinda out of scope in that I didn't know you could do that and don't need it. But I'm happy to try putting that in for completeness. However, the Custom Groups UI does not provide that option and I don't see how to do it with APIv4 Explorer. Could you provide more detail please? |
It's And then the {include} in the tpl has a parameter customDataSubType. I don't know how magic it is - if it can handle anything you throw at it. |
Partly what I mean by "magic" is that if for example it doesn't add an onChange handler on the financial_type_id field, or whatever field the user happens to put in grouping, that then rebuilds the custom data, then it wouldn't be properly functional anyway. |
f42cac7
to
5a8bcd7
Compare
@demeritcowboy - I think that now handles financial_type subtypes. |
@seamuslee001 @colemanw I've enabled custom fields on ContributionPage in core, and updated extension-compatibility.json to obsolete the contributionpagecustomfield extension. FYI, if you're testing, this needs to be applied to make the contributionpagecustomfield extension work on master (prior to this PR). I think that covers everything ... |
Overview
This adds the display of Custom Fields on ContributionPages.
Before
Custom Fields on ContributionPages can be configured by API but not displayed.
After
Custom Fields on ContributionPages are displayed at the bottom of the Settings tab.
Technical Details
Comments
The customDataBlock.tpl that pulls in custom fields only loads groups with
style
of'Inline'
.The GDPR extension creates custom fields on ContributionPages with
Inline
style but has its own code to display these as a tab. This PR causes those fields to also be shown on the Settings tab. This can be avoided by changing the style toTab
- I will create a PR for GDPR.