[dev.icinga.com #4233] URL construction issue in icinga_reload_scroll_position() javascript #1290
Comments
Updated by ricardo on 2013-06-01 12:59:50 +00:00
Hi, but what if there isn't a scroll option. Then it doesn't get set to a new value. |
Updated by ricardo on 2013-06-01 13:00:03 +00:00
|
Updated by ksuehring on 2013-06-01 13:53:17 +00:00
Good point. I'm attaching a patch that resolves that. Could probably be done more elegant, but I'm not a Javascript wizard ;-) |
Updated by mfriedrich on 2013-06-01 18:36:55 +00:00 well me neither. thanks for finding and fixing. |
Updated by mfriedrich on 2013-06-03 19:20:52 +00:00 i've assembled the 2 patches into a git patch - does not work for me. /icinga/cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=29 does not get any 'scroll' item initially added to the url string.
the issue is - the original code intended to remove all occurences of 'scroll' within the string, pushing a new entry after cleaning. the new code does not take that into account, and tries to replace existing 'scroll' occurences, but fails when there is none initially. so the patch requires rework, or the issue can be solved differently. |
Updated by ksuehring on 2013-06-03 19:25:43 +00:00 You can ignore the first patch. The one line of the second patch alone fixes the problem. After the scroll position is removed in the original code, it will just replace the first "&" with a "?" (if any) and the original code will add the scroll position to the end with the proper "&" or "?". |
Updated by mfriedrich on 2013-06-03 19:42:27 +00:00
|
Updated by mfriedrich on 2013-06-03 19:48:12 +00:00
ah ok, thanks for clarification. yes, that one works for me too. thanks for the fix, will be in 1.9.2 then. |
Updated by Anonymous on 2013-06-03 20:43:42 +00:00
Applied in changeset icinga-core:68b6717b2a8b10012140edcb46d4b2515beb44e3. |
Updated by mfriedrich on 2014-12-08 09:15:27 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/4233
Created by ksuehring on 2013-05-30 09:38:55 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2013-06-03 20:43:42 +00:00)
Target Version: 1.9.2
Last Update: 2014-12-08 09:15:27 +00:00 (in Redmine)
in html/js/page_refresh.js the function icinga_reload_scroll_position() tries to replace the "scroll=" part of the URL. The new scroll parameter is always added to the end of the URL. So the "?" operator might be moved behind other parameters.
The attached patch should solve the problem by changing the regex to replace the scroll position in place.
Attachments
Changesets
2013-06-03 19:46:57 +00:00 by (unknown) 68b6717
2013-06-17 20:00:42 +00:00 by ricardo 37bb277
The text was updated successfully, but these errors were encountered: