Customizable menu items/paths for donation module

venkat-rk - January 6, 2009 - 07:39
Project:Donation
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:jbomb
Status:closed
Description

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

jbomb - January 6, 2009 - 16:05

I've needed this functionality as well.

here's a quick patch.

AttachmentSize
donation-custom-path.patch 2.13 KB

#2

venkat-rk - January 6, 2009 - 17:09

jbomb, thank you. I shall test the patch and report back.

#3

jbomb - January 6, 2009 - 17:52

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

venkat-rk - January 8, 2009 - 16:09

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.

AttachmentSize
donation_path_patched.png 48.01 KB

#5

venkat-rk - January 8, 2009 - 16:13

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.

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

venkat-rk - January 8, 2009 - 16:15

Hmm...I just realized there is a third, hard-coded path: /about/donations.

Do you think that could be customized too?

#7

jbomb - January 11, 2009 - 23:17

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.

AttachmentSize
donation-5x-1.0_custom_paths.patch 3.03 KB

#8

jbomb - January 11, 2009 - 23:23
Title:Customizable menu items/paths for donation module» Customizable menu items/paths for donation module

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).

AttachmentSize
donation-5x-1.0_custom_paths_revised.patch 3.04 KB

#9

jbomb - January 12, 2009 - 00:20
Assigned to:Anonymous» jbomb
Status:active» needs review

#10

venkat-rk - January 12, 2009 - 14:12

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.patch
patching 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

jbomb - January 12, 2009 - 14:20

The newer patch should be applied to a clean copy of donation-5.x-1.0.

#12

venkat-rk - January 12, 2009 - 16:34

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.

AttachmentSize
donors_path_patched.png 59.26 KB

#13

kbahey - January 12, 2009 - 17:35
Version:5.x-1.0» 5.x-1.x-dev
Status:needs review» needs work

Can you reroll the patch against -dev? This is where all new stuff go. Stable releases are NEVER changed.

#14

jbomb - January 13, 2009 - 05:02

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

jbomb - January 14, 2009 - 05:38
Status:needs work» needs review

rerolled against 5.x-dev

includes custom paths and straightens out custom description for currency_code select field.

AttachmentSize
donation-5.x-dev-custom-path.patch 2.93 KB

#16

jbomb - January 14, 2009 - 05:43
Status:needs review» needs work

+     '#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

kbahey - January 14, 2009 - 21:15

Committed.

Should be in -dev tarball in about 5 hours.

#18

jbomb - January 22, 2009 - 05:17
Status:needs work» fixed

comment #16 was resolved in donation 5.x-1.1

#19

System Message - February 5, 2009 - 05:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.