Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Preserving field through modify?

Quote Reply
Preserving field through modify?
I've added another field to my link and validate tables called 'Package'. Works great, accept when a user modifys their information, it defaults back to the field default instead of carrying the old link info through and re-posting it back to the validate table.

Can someone show me how (without passing hidden fields in templates), when the script pulls the links existing info out of the database in its final call, it also includes that links existing 'Package' value when it posts it back to the validate table. I've tried adding a line (at the bottom) to this section below but I can't get it to work...

# Search for the link.
$db = new Links::DBSQL "$LINKS{admin_root_path}/defs/Links.def";
$links = $db->query ( { URL => $in->param('Current URL'), ww => 1 } );
($db->hits > 0) or &site_html_modify_failure ({ Category => $category, error => "The link was not found in the database", %in }, $dynamic ) and return;

# Convert to hash.
$links = $db->array_to_hash ( ${$links}[0] );
foreach $key (keys %{$links}) {
$original->{$key} = $links->{$key};
exists $LINKS{add_system_fields}->{$key} and next;
$links->{$key} = $in->param($key);
}
$links->{'Add_Date'} = $original->{'Add_Date'};
$links->{'Mod_Date'} = $db->get_date;
$links->{'LinkID'} = $original->{'ID'};
$links->{'Mode'} = 'Modify';


## MY ATTEMPT HERE FOR PACKAGE PRESERVATION THROUGH MODIFY
$links->{'Package'} = $original->{'Package'};


...Then the rest of the modify script untouched.

Thanks in advance.

Regan.

Subject Author Views Date
Thread Preserving field through modify? ryel01 3097 Oct 19, 2000, 6:38 AM
Thread Re: Preserving field through modify?
Stealth 3060 Oct 19, 2000, 8:03 AM
Thread Re: Preserving field through modify?
pugdog 3042 Oct 19, 2000, 11:39 AM
Thread Re: Preserving field through modify?
ryel01 3045 Oct 19, 2000, 3:23 PM
Thread Re: Preserving field through modify?
pugdog 3040 Oct 19, 2000, 6:38 PM
Post Re: Preserving field through modify?
ryel01 3031 Oct 19, 2000, 9:52 PM