Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Remote_Addr Magic String not working #685

Closed
craigs100 opened this issue Dec 13, 2021 · 1 comment
Closed

@Remote_Addr Magic String not working #685

craigs100 opened this issue Dec 13, 2021 · 1 comment

Comments

@craigs100
Copy link

craigs100 commented Dec 13, 2021

A brief description of the issue goes here.

Use of [@Remote_Addr] yields no result

Reproduction

If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:

Bug summary

Use of [@Remote_Addr] yields no result

Specifics

Using "[@Remote_Addr]" as the "Default Setting" for a Hidden Field answer type doesn't appear to work. i.e. the field in the web page source remains as an empty string.

Steps to reproduce

Umb 9.1.2 site with UmbracoForms 9.2.0-rc001 installed and hosted on Windows. Create a form, add a hidden field, and set it's default value to "[@Remote_Addr]" as shown:-
Screenshot from 2021-12-13 19-23-10
Add the form to a view.
Upload to a Windows server ensuring the site is running "in process" on IIS.
Look at the source of the view.

Expected result

<input type="hidden" name="7f2bea21-54b1-44e9-e9fe-0292315566c9" id="7f2bea21-54b1-44e9-e9fe-0292315566c9" data-umb="7f2bea21-54b1-44e9-e9fe-0292315566c9" class="hidden" value="123.123.123.123"/>

Actual result

<input type="hidden" name="7f2bea21-54b1-44e9-e9fe-0292315566c9" id="7f2bea21-54b1-44e9-e9fe-0292315566c9" data-umb="7f2bea21-54b1-44e9-e9fe-0292315566c9" class="hidden" value=""/>

It should be noted that the actual page in question correctly shows the IP Address as text using @HttpContextAccessor.HttpContext.Connection.RemoteIpAddress.ToString().

https://our.umbraco.com/forum/umbraco-9//107815-remote_addr-magic-string-not-working refers.

@AndyButland
Copy link

I've made an amend now in V9 so the same syntax as was available in V8 will work for retrieving the value of HttpContext.Connection.RemoteIpAddress.ToString().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants