Requisition UI breaks when percentage sign is used inside Foreign ID input field

Description

While working on NMS-7548 I stumbled across some problem in the requisition UI. When using a percentage sign inside a Foreign ID of a node, the node isn't editable anymore. Steps to reproduce:

  1. create a requisition

  2. add a node with Foreign ID set to something like aaa%20bbb

  3. hit Save and Return

  4. hit the Edit button

The resulting page is broken and it is not possible to edit the node or any of the associated fields. Synchronization and displaying of the resource graphs works - so, I think it just a encode/decode issue in the Web UI.

Environment

macOS, foundation-2016, org.opennms.rrd.storeByForeignSource=true

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Benjamin Reed April 18, 2017 at 9:50 AM

Passed in Bamboo, just need someone to approve/merge the PR and we're set.

Benjamin Reed April 17, 2017 at 4:40 PM

Yup, the angular requisitions UI wasn't escaping URLs with foreign sources (and foreign IDs) in them, so funky characters would get lost or translated improperly.

PR is here: https://github.com/OpenNMS/opennms/pull/1443

I was able to create, edit, and delete requisitions with % in their names with this patch.

Benjamin Reed April 17, 2017 at 3:38 PM

provision.pl did not work, but it appears that it's only because it did not escape things correctly

I fixed the script and now I was able to create foreign sources and foreign IDs with %s in them and they encoded/decoded correctly, so it appears the ReST API handles it just fine. Next I'll look at the javascript side.

Alejandro Galue April 13, 2017 at 7:25 AM

Have you tried to reproduce the problem using simple "curl" commands ? What about provision.pl ? I'm wondering if the problem is the UI or the ReST API (or both).

Fixed

Details

Assignee

Reporter

Components

Sprint

Affects versions

Priority

PagerDuty

Created April 6, 2017 at 8:12 AM
Updated June 27, 2017 at 1:36 PM
Resolved April 24, 2017 at 10:52 AM