Customizable menu items/paths for donation module
| Project: | Donation |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | jbomb |
| Status: | closed |
Hi,
I have a use case where a client wishes to use this module as part of their site's 'Get Involved' section. This means urls like www.domain.com/get-involved/donate and www.domain.com/about/supporters/donor-list (replacement for the module's donations listing page).
We can get the paths alright by using the alias feature in core, but because these don't have corresponding menu items, the breadcrumb trail is broken. Not having these paths hardcoded and having customizable menu items for these two urls would give those using this module a lot of flexibility by helping place these pages anywhere within a site's structure and not just at ../donate and ../donations.
If this sounds like a useful feature, I can get someone to submit a patch for this.

#1
I've needed this functionality as well.
here's a quick patch.
#2
jbomb, thank you. I shall test the patch and report back.
#3
Great! It looks like I forgot to add a custom path for the donor list in the previous patch. It shouldn't be any problem to add it as an option however, as it is now the "Text for the donors list page" will not automatically update the link to match the custom path that is defined as the "Donation List Path"
It seems that the easiest way to address this would be to put a warning in the description of the "Donation List Path" field.
Thoughts?
#4
jbomb, I tried your patch and it works great -breadcrumbs, menu placement and all. Please see the attachment.
It would be awesome if you could similarly add the ability to customize the donor list path too instead of putting in a warning.
#5
Oh, I get you now. I think there is no need to add functionality to update the links manually. And, yes, a warning will be useful. In fact, it will be good to add a warning about both the /donate and /donors paths.
#6
Hmm...I just realized there is a third, hard-coded path: /about/donations.
Do you think that could be customized too?
#7
Ok, I've added another field to customize the path to the donations list. I also noticed that about/donations isn't defined in the hook_menu implementation so I believe it's up to the administrator to create a node that has that path ... so that is already customizable.
#8
ok there was a small bug in the patch i submitted in the previous comment, the settings form was pulling the value for the donation path in both the donation path setting and the donation list path.
that's resolved in this one... (sorry).
#9
#10
Thanks!
Applied the latest patch against the already patched module and got the following:
root@host [/home/domain/public_html/sites/all/modules/donation]# patch < donation-5x-1.0_custom_paths_revised.patchpatching file donation.module
Hunk #1 FAILED at 10.
Hunk #2 FAILED at 98.
Hunk #3 succeeded at 107 (offset 1 line).
Hunk #4 FAILED at 118.
3 out of 4 hunks FAILED -- saving rejects to file donation.module.rej
#11
The newer patch should be applied to a clean copy of donation-5.x-1.0.
#12
All working great. Screen shot attached. I customized the path to /about/donors although I didn't bother changing the paths in the page's text while testing.
khalid, could you please review and roll this out into a stable release (not sure how the process works)?
Thank you very much, jbomb. Is there a way to contact you? You can reach me through my d.o contact form.
#13
Can you reroll the patch against -dev? This is where all new stuff go. Stable releases are NEVER changed.
#14
I'll try to reroll the patch later this week.
@Venkat-Rk
you can contact me using the contact tab on my drupal profile page.
#15
rerolled against 5.x-dev
includes custom paths and straightens out custom description for currency_code select field.
#16
+ '#description' => variable_get(DONATION_CURRENCY_TEXT, NULL),should be changed to
+ '#description' => variable_get(DONATION_CURRENCY_TEXT, DONATION_CURRENCY_DEFAULT_TEXT),In the patch above.
#17
Committed.
Should be in -dev tarball in about 5 hours.
#18
comment #16 was resolved in donation 5.x-1.1
#19
Automatically closed -- issue fixed for 2 weeks with no activity.