Charts with categories that contain a plus symbol do not display

Issue #535 resolved
David Platten created an issue

Part of the URLToArray JavaScript function isn't doing what it should:

request[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]).replace(/\+/g, ' ');

needs to be replaced with

pair[1] = pair[1].replace(/\+/g, ' ');
request[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);

Comments (11)

  1. Ed McDonagh

    When you want to merge this back in, please do it via a pull request, as this will automatically prompt Codacy to give it the once over... :-)

  2. David Platten reporter
    • changed status to open

    This change has broken the charts when no filters are in-place. Going to http://dev.openrem.org/openrem/ct/ when charts are already switched on results in empty chart DIVs. There needs to be a

    typeof pair[1] !== "undefined"
    

    check before trying to do the string replace. Will fix at home later on today.

  3. David Platten reporter

    Amended views.py to include a KeyError for when the form data is empty - occurs when a user first goes to the CT or radiographic pages. Doesn't affect mammo or fluoro pages as they do not have a filter for acquisition protocol. References issue #535

    → <<cset 66cf6cec28c8>>

  4. David Platten reporter

    Merged in issue535chartsFailWithPlus (pull request #100)

    Amended views.py to include a KeyError for when the form data is empty - occurs when a user first goes to the CT or radiographic pages. Doesn't affect mammo or fluoro pages as they do not have a filter for acquisition protocol. References issue #535

    → <<cset e5ba98904718>>

  5. Log in to comment