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

Table options -> Display as Link: Links prefixed with metabase's basePath #25350

Closed
nil0x42 opened this issue Sep 11, 2022 · 1 comment
Closed
Labels
.Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Type:Bug Product defects Visualization/Chart Settings

Comments

@nil0x42
Copy link

nil0x42 commented Sep 11, 2022

Describe the bug
Within a table question, i've set the name column display as link
The table contains two columns: name and url
So i've set name to display as Link, and i've set the following values:
2022-09-11_13-59

Therefore, when i visualize the question, the url is prefixed with metabase's base url.

For example, if question is:

select 'google' as name, 'https://www.google.com' as url

The url points to: https://metabase.mycompany.com/https://www.google.com, instead of the expected https://www.google.com

Logs
Please include javascript console and server logs around the time this bug occurred. For information about how to get these, consult our bug troubleshooting guide

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'New -> SQL Query'
  2. Use select 'google' as name, 'https://www.google.com' as url as query
  3. On Settings, click icon to edit display for name column
  4. Set display as Link, set {{name}} as Link text, set {{url}} as Link URL
  5. Click Done, and click on google link, it redirects to a wrong link prefixed by metabase instance base url.

Expected behavior
Link is not prefixed by metabase's base url

Information about your Metabase Installation:

{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0",
    "vendor": ""
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.16.1+1",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.16.1",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.16.1+1",
    "os.name": "Linux",
    "os.version": "5.4.0-125-generic",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "postgres",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "12.12 (Ubuntu 12.12-0ubuntu0.20.04.1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.4.1"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-08-31",
      "tag": "v0.44.2",
      "branch": "release-x.44.x",
      "hash": "8d9de8a"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity
It makes display as Link almost unusable. Definitely not critical for metabase as a whole, but that feature doesn't work properly.

@nil0x42 nil0x42 added .Needs Triage Type:Bug Product defects labels Sep 11, 2022
@flamber flamber added Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Visualization/Chart Settings .Frontend and removed .Needs Triage labels Oct 9, 2022
@flamber
Copy link
Contributor

flamber commented Oct 9, 2022

The reason for this behavior is because the variables are URL encoded. There's a request for allowing defining encoding or simply just don't encode the first variable #14846. Closing in favor of that issue.
Instead of using the NAME column to apply the link, use the URL column and only apply the NAME variable for the link text:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Type:Bug Product defects Visualization/Chart Settings
Projects
None yet
Development

No branches or pull requests

2 participants