Closed (fixed)
Project:
Location
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
25 Jul 2007 at 20:17 UTC
Updated:
4 Sep 2007 at 05:52 UTC
Jump to comment: Most recent file
Comments
Comment #1
michelleAny chance of getting this and the phone version alluded to for 5.x? Would be really nice to have the field in with the address instead of adding phone numbers separately.
Thanks,
Michelle
Comment #2
bomarmonk commentedComment #3
bomarmonk commentedOkay, here are both the phone and fax modules with .info files for Drupal 5. Unfortunately, I'm not a PHP coder, so these need some work. but for now they are displaying my existing phone and fax numbers in the nodes and node forms... but again, this needs work, so I'm hoping someone will review and rework these small but helpful modules and add them to the official 5.x release. Thanks to anyone willing to polish this off!
Comment #4
bomarmonk commentedChanging version...
Comment #5
michelleThanks!
My PHP is very weak so I can't really help with cleaning it up but I can test it out.
Michelle
Comment #6
michelleI've had no luck getting this to work. I can see in the code that it's adding extra options but they aren't showing up. Did you try this in 5.x?
Thanks,
Michelle
Comment #7
michelleOk, I compared the code against the location module and made some blind changes. No clue what the difference is, but it seems to work.
At the top, I coped over 2 lines so it looks like:
For the other part, it now looks like:
I don't know if there's anything else that needs to be changed. So far it seems to be working.
Michelle
Comment #8
michelleI did some more testing and the only thing I can find wrong is that the content type settings page keeps reverting back to do not collect on both phone and fax. The content type does allow me to enter them, though. So internally it realizes that I've set it; the setting just isn't reflecting that. Either that or it's ignoring the setting. Since I changed the setting before editing the node, I'm not sure which it is. I can do further testing a bit later to see which it is.
Michelle
Comment #9
michelleSorry for the zillion posts. I don't know how long I'll be able to be on the computer before the baby wakes up so I keep giving all the info I have.
Anyway, I just confirmed that, with my changes, it adds the phone/fax to the form regardless of the settings. So it looks like the settings page isn't working and the form is ignoring the settings.
I don't know enough to know why, though. :(
Michelle
Comment #10
bomarmonk commentedOdd... I'm not a PHP guru myself, so most of what I did was copy over the phone module in 4.7 and then I built the .info files so the modules would at least be recognized in 5.0. There may be some coding changes that need to be updated in the little modules themselves. They are working on my site, but I already had data stored in those fields, so I'm not sure that makes a difference. Anyway, I hope someone with real expertise can make these completely viable. Thanks for testing... it's one step closer, at least.
Comment #11
michelleI've been thinking about this more and I'm not convinced separate modules are really needed. Each field has its own option, anyway, so having these as separate modules is just an extra step. I think it would make more sense to make a patch that adds these two fields to location.module where all the other ones are. What do you think?
Michelle
Comment #12
bomarmonk commentedMichelle, that sounds more efficient. I wonder what the maintainer of the module thinks? These aren't very big additions... so it seems prudent to just include them in the main project. Then again, I'm not a project maintainer.
Comment #13
ankur commentedI went ahead and just ported the location_phone module to 4.7 (it involved changing 3 lines of code). I added a location_fax module. The location_fax module is just an exact copy of location_phone except it replace every occurrence of the word phone/Phone w/ fax/Fax, which is a less than ideal way of doing this. Ideally, I would've added some layer of abstraction that allows you do define an extra location field and whether this field should be numeric or not. Anyway, maybe I'll do something like that on the port to Drupal 6.
Also, note that the update does not change the theming of location in anyway, meaning that on the node-view, location phone numbers and location fax numbers simply aren't displayed. You have to change this yourself at the theme level. The key in the array are 'phone' and 'fax', respectively. I may, in the future, add some way automatically having the extra location fields added to the location view through some kind of internal (i.e., location-only) hook.
-Ankur
Comment #14
michellePerfect! Thanks very much for doing this.
Michelle
Comment #15
(not verified) commented