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

data being "lost" from add.html

Quote Reply
data being "lost" from add.html
Hi,
I've added two new fields (city, missing_location) to my links table and the add.html. But when data is entered in the add.html it is not actually being transfered to the database. The rest of the add process works, and when I validate the link I can add these lost fields. But I don't know why the data for these new fields is being lost.

Should the %db_def in Links.def match the %db_def in Validate.def? I believe this may be causing the problem since my two new fields are not listed in Validate.def Here's the last few lines of each:

Links.def
%db_def = (

ReceiveMail => ['15', 'CHAR', '0', '3', '0', 'No', 'Yes|No', '0'],
city => ['16', 'CHAR', '25', '35', '0', '', '', '2'],
missing_location => ['17', 'CHAR', '35', '45', '0', '', '', '0']
);

Validate.def
%db_def = (
ReceiveMail => ['16', 'CHAR', '0', '3', '1', 'Yes', 'Yes|No'],
Mode => ['17', 'CHAR', '0', '8', '1', 'Validate', 'Validate|Modify']
);

If they do need to be in sequence, is it possible to initialize the Validate.def so that it reconfigures itself?

Any advice is greatly appreciated.
Quote Reply
Re: data being "lost" from add.html In reply to
Yes...you must have the fields listed in the validate.def also.

I noticed when you use the table editor in the admin, it adds the fields to the links.def, but not to validate.def.
Maybe this is a bug.
But the add process uses the validate.def for adding.
Put your 2 new fields in there and it should work fine.
Do not just copy and paste, as the links.def has one more column than the validate.def.
Links.def has an extra column at the end for index weight, and validate.def does not have this.

Chris
Quote Reply
Re: data being "lost" from add.html In reply to
Thanks Chris. That fixed it. (I also had to add the cooresponding field_names to the Validate table.)
Quote Reply
Re: data being "lost" from add.html In reply to
Yes...forgot about that.

Chris
Quote Reply
Re: data being "lost" from add.html In reply to
Yep.. this may have been my biggest perl to the forum Smile

Hopefully Alex will address it in the next release -- that updates to the Links table will also be reflected in the Validate table.

the _best_ way would be to ask if these changes should also be made to the validate table as well. Probably as a pre-checked check box near the SUBMIT button. That way if the validate table has fields not used by Links, you won't alter them, but any field addtions, deletions or modifications to the Links table are also done to the Validate one.