DNNCommunity / DNN.FormAndList

Design your own table complete with field types, validation and custom user permissions.
MIT License
28 stars 20 forks source link

URL datatype does not provide link to external URL #65

Closed sleupold closed 5 years ago

sleupold commented 5 years ago

Describe the bug

If you use a column of data type "URL", enable "Track Number of Downloads" and add a row with an http or https link, the link is properly displayed in caption but the link simply contains current page address.

To Reproduce

Steps to reproduce the behavior:

  1. Add FnL to a page
  2. Add a column of type "URL" and enable checkbox Track Number of Downloads. Save (without entering a value for caption)
  3. Add a record with an URL like "http://www.github.com" and save
  4. See the url properly displayed, but when you click it, it just reloads the current page.

Expected behavior

you are forwarded to the displayed page

Error log

non

Additional context

variables file and file_UDT_URL in XML view are not properly populated (blanks added):

< File> < !--https://www.github.com-->< a href="">https://www.github.com< /a> < /File>

SCullman commented 5 years ago

@sleupold , thank you for reporting! Do you want to try to fix the issue? 🙏 Of course I can help you along the way, but most of the code and concepts should still be familiar to you.

sleupold commented 5 years ago

@SCullman atm i am not sure, whether it is a FnL issue or a feature ripped out of DNN platform. Still investigating.

SCullman commented 5 years ago

@sleupold I am quite sure it is a bug. See here, url is unmodified (and just empty) if it is set to Url and tracking. And there are no extra actions taken for any other link type to enable tracking.

sleupold commented 5 years ago

@SCullman other data types are using linkclick.aspx handler, but do not count clicks either. I am travelling atm, will have a look nect but one week. PS: I encountered the issue, while trying to support another community member.

SCullman commented 5 years ago

Well, this is fixed. But shouldn't the download number appear anywhere? I cannot remember.

SCullman commented 5 years ago

Ok, with DataType LookUp and token [File:Clicks]. The urlController is always initialized with false , as the setting URLDownloadTrackingis not set anywhere, AND it should be controlled by the proper field setting.

vmasanas commented 5 years ago

I have a similar issue if you just select a file, not a url. In this case a link limilar to this is generated:

/LinkClick.aspx?fileticket=ORvcmU6B_Us%3d&tabid=3708&portalid=0&mid=10056

The problem is that on DotNetNuke.Services.FileSystem.FileServerHandler, line 71 this will not correctly identify the mid or tabid parameters so any tracking fill fail.

if (context.Request.QueryString["mid"] != null) { Int32.TryParse(context.Request.QueryString["mid"], out ModuleId); }

BTW, if you select a File, not a URL, should not it also ask for tracking?

SCullman commented 5 years ago

It's starting to feel like a family reunion here.

SCullman commented 5 years ago

New release 6.5.4 available for testing. @sleupold , @vmasanas Thank you for reporting and commenting, is was indeed helpful.

vmasanas commented 5 years ago

@SCullman I installed the new version of the module but I still see the url has the same format as before. The link I see there is ..../LinkClick.aspx?fileticket=jbdt2JJoHbA%3d& amp; tabid=3708& amp; portalid=0& amp; mid=10056

am I missing something here?

SCullman commented 5 years ago

@vmasanas Can't reproduce. I see links like /LinkClick.aspx?fileticket=wX7FnQbzE18%3d&tabid=33&portalid=0&mid=381&language=en-US And I double checked and verified that the correct assembly (tagged with fileversion 6.5.4) is both in my bin and in release.

Btw, if you test with old data: