Adding Family:group option to Family:location
DL - July 9, 2008 - 07:37
| Project: | Family Tree 2 |
| Version: | 5.x-3.0-beta3 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | pyutaros |
| Status: | closed |
Description
It would be nice to have an option to add Family:group to the Family:location node similar to Family:individual having Family:group selection

#1
I like your idea as it is something that work make attaching individuals to locations in bulk easier. I have therefore added it in but i dont have access to to CVS so cant upload straigt into the module so do the following:
run the following line in your mySQL database or similar using phpMyAdmin or similar. Adding a table prefix if you have one.
ALTER TABLE `family_location` ADD `related_group` INT( 5 ) UNSIGNED NULL DEFAULT NULL AFTER `country` ;then upload over the current location.inc the attached file
This should make the changes but will only allow you to associate one group to each location, hopefully in the future I can change this to multiple groups.
#2
1 question: has this feature been committed to cvs?
#3
not as far as i know, i haven't.
#4
Changes have been committed to CVS.
Notes:
Do not manually run the SQL query. Update.php will take care of this after the module has been updated.
I'm assuming these changes were made against the latest CVS files.
Consider making a patch in the future rather than uploading individual files. http://drupal.org/patch
Sorry for the extreme lack of activity lately. I'm having some employment issues that are severely sapping all of my time and resources. I'll message you later with my immediate plans for the module.
PS - Is import currently working?
Thanks,
Jonathan
#5
will test the update, thanks
#6
I downloaded the 5.x.3.1 and updated the module. I tried to edit the location index to add an ancestry and this is what I got:
user warning: Unknown column 'related_group' in 'field list' query: UPDATE family_location SET vid='7', title_format='Some title', building='Some building', street='Some street', city='Some City', county='Some County', state_province='some state', country='some country', related_group='5' WHERE nid='7' in /home/username/public_html/mysite/includes/database.mysql.inc on line 172.
#7
have you run update.php?
#8
yup, it added 1 table in DB, should I run it again?
#9
Still dont understand how to make patches so I will give you the new file. replace family.install with the following and then run update.php again this should work
#10
I think you have the order of these updates wrong. Update numbers have to remain static to provide a sequence between versions.
function family_update_1() {$ret = array();
$ret[]=update_sql("
CREATE TABLE {family_variable} (
name VARCHAR ( 128 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
variable LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL
) ENGINE = MYISAM
");
return $ret;
}
function family_update_2(){
$ret = array();
$ret[]=update_sql("
ALTER TABLE {family_location} ADD related_group INT( 4 ) UNSIGNED NULL DEFAULT NULL AFTER country
");
return $ret;
}
Unless you can show me what I'm missing, I'm going to reverse order of these two.
#11
Nooooo DONT reorder them.
Some people will have update 1 already applied so by them changing it to update 2 when then apply update 2 it will repeat the update already made and not do what should be update 2. It doesn't matter that the changes were made in a different order as it will apply all updates up to the one that needs doing.
not sure if that all makes sense but basically dont reorder them
#12
It doesn't makes sense. I'm looking at api.drupal.org, and that's exactly the opposite of what it says you should.
http://api.drupal.org/api/function/hook_update_N/5
Help me understand why this is different.
#13
It says:
So when you add a second update, as we are doing, the first one stays as 1 and the new one is 2. Which is what I have done. Even though i think i posted the update before you added yours then you shouldn't change the order in which you add them to CVS.
#14
I think that's what I'm saying. The updates are a different order in CVS. Inputting them the way that you have them listed will change that order. That's why I want to change the order of what's in the file you updated. Am I still wrong?
#15
You added the family_variables update to CVS in 3.1 and called it update_1 (It will always be update 1 now) then I came along and added update_2 (which should always now be update 2) afterwards with the related_group update. This should be how they are labelled and i think they are labelled like this but if not I'm sorry they are supposed to be changed.
#16
Microbe,
Let me just apologize. I must be half dead, asleep, or something. They are in the right order. They have always been in the right order. I'll go ahead and apply it as is.
Sorry again,
Jonathan
#17
Okay changes have been applied to CVS. New version 5.x-3.2 available. Going to go check my head. Microbe, I'm going to take the conversation offline now to discuss going forward.
#18
thanks, will test this ASAP.
#19
just tested it and there was no error like i reported in #6. great work
#20
Setting to fixed.
#21
Automatically closed -- issue fixed for two weeks with no activity.