You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The initFormValues function in the pat/internal/forms/forms.go file initialises a number of form values which are 'blanking' out values when the html form is submitted back to the Pat interface. This results in some forms being sent with blank fields.
As an example the Winlink Check-in form has the Message To field and the Form 1b. To: field blanked out when the Form is submitted back to the Pat "New Message...' window.
Note this is one example, there are other forms affected.
The code in the initFormValues function is shown below (line 990 Pat v0.15.1):
// some defaults that we can't set yet. Winlink doesn't seem to care about these // b.FormValues["msgto"] = "" // b.FormValues["msgcc"] = "" // b.FormValues["msgsubject"] = ""
Note, I have commented these out and recompiled Pat and confirmed that all works as it should when these are not reinitialised.
I would suggest that the values should either not be initialised as they are, or a test is carried out to check if they contain data before initialising them.
I'm not sure why they are needed and my go coding knowledge is limited so I've not posted a patch. I only checked a few forms, some other variables being initialised may affect other forms?
Example form showing the problem fields (note these are showing after the code correction above) - without the change they are blank:
The text was updated successfully, but these errors were encountered:
We're in the process of a major rewrite of the templates engine in Pat. I believe this is one of the things that have already been fixed in the revamp (#443). Can you please try compiling the branch more-templates-improvements?
I have just built the more-template-improvements tree, and it appears to now work as expected. This was just a quick check for the Check-in Form. Over the next little while I'll test a few other forms and if I find issues I'll report back here.
Many thanks for your quick response and the work that you and others do for this project.
There is still a couple of missing features I'd like to add, but I believe the changes in that branch are good enough to be included in the next release. Before merging I need to verify that the changes does not break existing functionality. So any feedback is much welcomed.
The
initFormValues
function in thepat/internal/forms/forms.go
file initialises a number of form values which are 'blanking' out values when the html form is submitted back to the Pat interface. This results in some forms being sent with blank fields.As an example the
Winlink Check-in
form has the MessageTo
field and the Form1b. To:
field blanked out when the Form is submitted back to the Pat "New Message...' window.Note this is one example, there are other forms affected.
The code in the
initFormValues
function is shown below (line 990 Pat v0.15.1):// some defaults that we can't set yet. Winlink doesn't seem to care about these
// b.FormValues["msgto"] = ""
// b.FormValues["msgcc"] = ""
// b.FormValues["msgsubject"] = ""
Note, I have commented these out and recompiled Pat and confirmed that all works as it should when these are not reinitialised.
I would suggest that the values should either not be initialised as they are, or a test is carried out to check if they contain data before initialising them.
I'm not sure why they are needed and my
go
coding knowledge is limited so I've not posted a patch. I only checked a few forms, some other variables being initialised may affect other forms?Example form showing the problem fields (note these are showing after the code correction above) - without the change they are blank:
The text was updated successfully, but these errors were encountered: