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

Less than sign inside items and labels of graph make them broken #465

Closed
coozoo opened this issue Mar 22, 2017 · 4 comments
Closed

Less than sign inside items and labels of graph make them broken #465

coozoo opened this issue Mar 22, 2017 · 4 comments
Labels
bug Undesired behaviour

Comments

@coozoo
Copy link

coozoo commented Mar 22, 2017

Hi sorry for that very small bug :)
If set less than sign (<) for label and item it will make them broken.
Greater than sign works fine(>).
In label and item it behaves in little bit different way if replace with escape sequences please see below.

  1. Example for an old version 0.8.8 - correct result
    lessthan0 8 8

In graph debug it's converted to this:
--vertical-label="test(down if <1)" \ GPRINT:a:MIN:"MIN(<1)\:%8.2lf %s" \

So pay attention to double quotes inside command.

  1. Current result version 1.0.4 - incorrect result
    lessthan1 0 4

In graph debug it's converted to this:
--vertical-label='Sitecore State (down if <1)' \ GPRINT:a:MIN:'DOWN(<1)\:%8.2lf %s' \

Pay attention that in new version it's single quoted.

  1. Current result version 1.0.4 escape sequence - incorrect result
    lessthanescapesequences1 0 4

In graph debug it's converted to this:
--vertical-label='Sitecore State (down if &lt;1)' \ GPRINT:a:MIN:'DOWN(lt;1)\:%8.2lf %s' \

You can see that escaped works fine for label, but inside item ampersand sign is missed that's why workaround doesn't work here.

Thank you

@cigamit
Copy link
Member

cigamit commented Mar 22, 2017

Well, we have been trying to simplify the lib/rrd.php code. We escapted the title, but not the axis or the legends. So, I'm not surprised. Thanks for reporting. Should not take to long to find the proper approach to resolving this.

@cigamit cigamit added the bug Undesired behaviour label Mar 22, 2017
cigamit added a commit that referenced this issue Mar 23, 2017
Less than sign inside items and labels of graph break graph
@cigamit
Copy link
Member

cigamit commented Mar 23, 2017

Please test with the latest lib/rrd.php and provide feedback. Thanks for reporting.

cigamit added a commit that referenced this issue Mar 23, 2017
cigamit added a commit that referenced this issue Mar 23, 2017
@coozoo
Copy link
Author

coozoo commented Mar 23, 2017

Hi thanks, I've tested it little bit
Less than fixed
but another side effect appeared
Line breaks (Insert Hard Return checkbox <HR>) for items are not correctly working there is n (suppose it's somehow related to replacing backslash in \n) at the end of each string
linebrakebroken

And you can see that there is case that sometimes linebreaks works but still n at the end
linebrakebroken2

In both cases rrd command, on webpage from debug, looks identically:
GPRINT:cdeffa:LAST:'CUR\:%8.2lf %s'\n \
So i'm not sure what the reason of this.
thank you

cigamit added a commit that referenced this issue Mar 23, 2017
I noted that the various functional blocks are escaping differently,
which is a clear sign you need to modularize that section of the code.
Project for another day though.
@coozoo
Copy link
Author

coozoo commented Mar 23, 2017

Great work, thanks now it works fine :)

correctmultilinelessthan

@cigamit cigamit closed this as completed Mar 24, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour
Projects
None yet
Development

No branches or pull requests

2 participants