Don't use "&" in page paths in Perspective

I have a project where someone used “&” as part of the page path for a screen (the path configured from the gear icon). It works when you navigate to the page but if you happen to be on the page and log out you will lose everything after the “&” in the URL which will cause it to say “View not found”.

It’s a very obscure thing that probably won’t effect many people but I thought I’d mention it in case anyone encounters this problem and searches the forum. I’m sure a dev will see this and fix the problem before it impacts many people anyway.

Reproduced up to 8.08.

PS
If anyone is wondering why someone would use an & in a page path. The page path was to a P&ID screen.

This isn’t surprising beacuse & is how you join multiple URL parameters, they aren’t a valid part of a URL path.

For instance, in a YouTube URL like: https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=1,

there are two URL paramters, v=dQw4w9WgXcQ and t=1. The & character joins them together and therefore has special meaning inside of URL’s.

For instance, if your view URL is:

https://example.com/data/perspective/client/MyProject/P&ID, then that URL will be parsed out as “oh, there’s an &, whatever’s after it is a URL parameter”

Just figured I’d offer an explanation for anyone thinking this is something that could be fixed, or thinking it’s a bug with Ignition itself. I don’t believe it is.

3 Likes

You might try URLencoding the ampersand as %26 instead.

Yeah, I saw what the problem was immediately because I knew about query string parameters. I was just pointing it out for anyone who might stumble into this. Also, I figured this will get fixed relatively quickly so that & becomes an invalid character for page path definitions.

It’s kind of strange because the page path actually works from links but if you log out while on the page it breaks.