Dnn.Platform
Dnn.Platform copied to clipboard
Multiline Profile property does not "render" breaks on user profile page
Description of problem
When you set a Profile property field to "Multi Line Text" and you add this to the user profile page the entered breaks are not visible.
Description of solution
IMO we should replace "\n" with "
", so the entered breaks are visible when shown in the profile.
I know this is a change, but if we don't change this, what's the use of the "Multi-Line Text" type..?
As all properties seem to be handled here: https://github.com/dnnsoftware/Dnn.Platform/blob/34a5a5582c394d45e76baec656ada86d3078453c/DNN%20Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs#L193
I would suggest to add an option for "Multi-Line Text" in there and add a .Replace("\n", "
").
Reproduce.
- Set a profile property (Biography) to "Multi Line Text"

- Edit a user profile and add this text as Biography.
-------------
Test1
Test2
Test3
-------------
- Visit the User Profile page of that user.
- Edit the "ViewProfile" module's Template and add: [PROFILE:BIOGRAPHY]
- After the page has reloaded you will see that the entered breaks are not shown. (as obviously "\n" is not a break in HTML)

FYI if we can agree on the solution we will create the PR.
@Timo-Breumelhof thank you, your solution sounds great to me!
Yes, either replace \n with <br/> or render using a CSS class that applies white-space: pre-line
I had to do something similar in another issue/PR: https://github.com/dnnsoftware/Dnn.Platform/pull/4186
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
Still relevant.
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future. Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all. Thank you for your continued involvement and contributions!
:-)
Is this still reproducible in v9.10.1, I have a feeling a PR came for this, can someone test/confirm...
Unfortunately, that PR that @valadas mentioned is not working for this release. I had made that PR a few releases back. Weird...

Yeah I can reproduce in 9.10.1