I’ve created a New-UDForm that my user’s fill out.
OnSubmit I’m getting the values of the fields like:
$myValue = (Get-UDElement -Id 'myID').value
This works fine.
Now in order to avoid my users filling out the form multiple times with the same information I’ve added a “Copy” button that sets all the fields back to what they previously submitted like:
This works in the sense that the user can see all the various input fields filled out. However, when the form is submitted the second time, the “Get-UDElement” method doesn’t work on the second submission. The values are coming up blank.
Anyone know what I am doing wrong or if this is just a bug?
The other issue I’ve noticed is when setting back values to textbox fields it doesn’t apply the “filled” css so the text ends up being covered by the label.
One thing I would try to do, in terms of resetting the form, would be to wrap the form in a New-UDDynamic and call Sync-UDElement on that to cause it to totally recreate the form.
Yeah, that might work - I get what you mean. It’d take some finagling though since I basically have a form + a shopping cart and am initializing some values on form load that I would not want to reinitialize after their first submit.
One thing I did notice though, is I just updated to 1.3.1 on my development box and now the “Copy” button doesn’t work at all anymore, no code changes at all to my knowledge.
So if you think it is a bug that might be fixed in the near future i’d rather just wait and avoid shuffling all my code around but if it’ll be a few weeks I may have to do that.
Let me know if you want me to go make a bug on github.
Ok. I gotcha. I’ll throw this into our 1.3.2 bug fix release. It should be out in the next week or so.
Can you please check the browser console (F12) to see if there are any errors? I’m not seeing any issues with buttons in my 1.3.1 instance. Can you also check the dashboard log in the admin console?
I get what you’re saying but that was not necessary at all in previous versions with the same code.
I actually found another spot where code that worked in (3.0.0-beta7) is now broken in 3.0.2. Same situation where I am using the $_ variable.
Cache shouldn’t be an issue here because when I say I “updated” I actually got a brand new laptop and installed the new version of Universal to what was essentially a virgin PC. Not to mention, I pretty much live the “Ctrl + F5” life.
Installed 1.4 this morning over the top but my dashboard, edited the properties of my existing dashboard and changed the framework version to 3.1.0 - now it won’t start at all.
I also notice significantly less output in the log and it seems to think it has started almost immediately but without any info in the log I’m not really sure of a direction to troubleshoot.
I tried stopping the service and deleting any of the older framework versions out of my c:\programdata directory but that didn’t seem to make a difference.
No errors in browser console either, this is all I see:
I haven’t done any advanced debugging yet by attaching to the session or anything like that, i’ve been able to get by with the log up until this point.
Thanks that log in programdata might have helpful info it looks like?
2020-09-22T09:24:39.4474035-07:00 0HM2V2G0BT2PO:00000001 [WRN] Error unprotecting the session cookie. (65f95c31)
System.Security.Cryptography.CryptographicException: The key {8e920a9a-eb39-4f45-a241-02cb709862dd} was not found in the key ring.
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
at Microsoft.AspNetCore.Session.CookieProtection.Unprotect(IDataProtector protector, String protectedText, ILogger logger)
2020-09-22T09:24:39.4475854-07:00 0HM2V2G0BT2PP:00000001 [WRN] Error unprotecting the session cookie. (65f95c31)
System.Security.Cryptography.CryptographicException: The key {8e920a9a-eb39-4f45-a241-02cb709862dd} was not found in the key ring.
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
at Microsoft.AspNetCore.Session.CookieProtection.Unprotect(IDataProtector protector, String protectedText, ILogger logger)
Let me know if that leads you any direction or not, if not I can see about sending some ps1s over.
This error is likely not the issue. It happens when an old cookie is used with a new server but a new cookie should just be issued so it’s usually not a problem. You can try to clear your browser cookies to see if they makes that error go away. Some PS1s would likely be helpful.
I updated to the latest nightly again and checked that same log - see this now:
2020-09-23T10:14:36.4830711-07:00 0HM2VSG1J0G6S:00000014 [ERR] Failed to get dashboard (588ddaf8)
Grpc.Core.RpcException: Status(StatusCode=Unknown, Detail="Exception was thrown by handler.")
at Universal.Server.Services.DashboardProxy.GetDashboard(Guid sessionId, String[] roles, String appToken)
Sending PS1 file is difficult since it is dependent on pulling data from SQL and AWS with creds.
I deleted the folders in c:\programdata then zipped up my working installation from my other machine, pasted that in my program files(x86) and started the service, works fine again.
So now I can switch back and forth pretty easily between versions to demonstrate this.
A call would be great - should I just email you at adam (at) poshtools?