Dnn.Platform icon indicating copy to clipboard operation
Dnn.Platform copied to clipboard

Multiline Profile property does not "render" breaks on user profile page

Open Timo-Breumelhof opened this issue 4 years ago • 11 comments
trafficstars

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.

  1. Set a profile property (Biography) to "Multi Line Text"

image

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

image

Timo-Breumelhof avatar Feb 12 '21 10:02 Timo-Breumelhof

FYI if we can agree on the solution we will create the PR.

Timo-Breumelhof avatar Feb 12 '21 10:02 Timo-Breumelhof

@Timo-Breumelhof thank you, your solution sounds great to me!

sleupold avatar Feb 12 '21 11:02 sleupold

Yes, either replace \n with <br/> or render using a CSS class that applies white-space: pre-line

bdukes avatar Feb 12 '21 14:02 bdukes

I had to do something similar in another issue/PR: https://github.com/dnnsoftware/Dnn.Platform/pull/4186

WillStrohl avatar Feb 12 '21 17:02 WillStrohl

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!

stale[bot] avatar Jun 02 '21 16:06 stale[bot]

Still relevant.

WillStrohl avatar Jun 02 '21 21:06 WillStrohl

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!

stale[bot] avatar Sep 03 '21 01:09 stale[bot]

:-)

Timo-Breumelhof avatar Sep 03 '21 06:09 Timo-Breumelhof

Is this still reproducible in v9.10.1, I have a feeling a PR came for this, can someone test/confirm...

valadas avatar Sep 06 '21 02:09 valadas

Unfortunately, that PR that @valadas mentioned is not working for this release. I had made that PR a few releases back. Weird...

image

WillStrohl avatar Sep 07 '21 16:09 WillStrohl

Yeah I can reproduce in 9.10.1

valadas avatar Sep 07 '21 20:09 valadas