-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Issue #899: don't show PCPs where the events or contribution pages are disabled or past the end date #20845
Conversation
(Standard links)
|
I've updated it to allow for empty end dates. I wasn't sure about checking end dates, though it seems necessary since it's not practical for users to disable events after they are done. And would be useful for contribution pages too. |
@herbdool I gave this a quick test and you end up with I think it would be better to still list the inactive pages, indicate that they are expired/inactive and on the PCP page itself disable the donate link / indicate that the campaign is no longer active (but still be able to share the historical page so you can eg. see how much was raised). |
@mattwire doesn't seem to me that the dashboard really needs to keep all that info for disabled contrib/event pages. They would still be visible on the admin side. Perhaps we could be more conservative and still show them regardless of end date (take that part out of my PR) and only exclude them where And then a new issue could be for putting an "expired/inactive" indicator on the PCP admin page. |
@herbdool My opinion was that as the dashboard is for the end user they would like to see a history of all their old pcp pages (eg. if they do a campaign every year). I am happy to be persuaded otherwise but it seems a simple fix to remove the links instead of the whole line? |
@mattwire I've updated the PR to show any existing PCPs for the user (even for inactive pages), but for the "Create a PCP..." only show contribution or event pages which are active and end in the future. Is that better? I also fixed the query so it actually includes an end_date for the template. Before, all rows showed "Ongoing" regardless of the actual end date. Odd, that there were a few places in the template where the variables output weren't being passed at all. PCPs not getting much love. Also, I removed a float from the "Create a PCP..." section. Looked ugly and broken even though it was done on purpose years ago I believe. After: |
@herbdool That sounds fine to me! Looks like there is a test failure caused by this change? That might be expected but can you check and fix the test if necessary? |
I should get around to running Civi tests locally. This is taking a long time for small tweaks. |
@mattwire finally. A few tries there. I also finally got the buildkit set up locally; that took awhile. |
@mattwire by the way, what's the best way to squash commits once the PR has already been pushed? I'm used to Backdrop PRs where the person merging does the squash. |
@herbdool just looking at your large question - you can use
One more thing - there is a preferred syntax for referring to the gitlab issue - you can copy it from within gitlab if you scroll down & look for the little clipboard symbol next to it |
test this please |
@colemanw or @eileenmcnaughton or @totten can one of you merge this PR? |
Thanks @herbdool @mattwire @BettyDolfing @jaapjansma and @eileenmcnaughton - good group effort! |
Fixes https://lab.civicrm.org/dev/core/-/issues/899
Overview
This will only show PCP links on the user dashboard if the event or contribution page is active, or if either is before the end date, if set.
Before
See https://lab.civicrm.org/dev/core/-/issues/899. If an event or contribution page is disabled the PCP links still show. They also show for events and contribution pages that are past their end date, if set.
The link was also broken if it was a contribution page.
After
This will only show PCP links on the user dashboard if the event or contribution page is active, or if either is before the end date, if set.
It also fixes the link to the event or contribution.
Technical Details
Adds joins to contribution pages or events so it can add more conditions.