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