Project

General

Profile

Bug #10574

Typing an apostrophe breaks free-entry portfolio fields

Added by Boone Gorges 7 months ago. Updated 7 months ago.

Status:
Resolved
Priority name:
High
Assignee:
Category name:
Public Portfolio
Target version:
Start date:
2018-10-23
Due date:
% Done:

0%

Estimated time:

Description

Haven't tested across browsers, but at least in Firefox:

1. Edit portfolio
2. Create 'Academic Interests' field
3. Type something that contains a single apostrophe
4. Click OK

Nothing happens, and you get a console error from jQuery. What appears to be happening is that the apostrophes are going into the DOM somewhere as unescaped, which means they're breaking jQuery's html() method.

I've played for a few minutes with a solution that catches apostrophe input and converts it to an HTML entity, but it doesn't seem to be a quick fix. I'm attaching a WIP diff so I can pick this up later.

cacap-apostrophes.diff (2.29 KB) cacap-apostrophes.diff Boone Gorges, 2018-10-23 10:46 AM

Related issues

Related to CUNY Academic Commons - Bug #10565: Escape Characters show in Academic Interests on People PageResolved2018-10-19

History

#1 Updated by Boone Gorges 7 months ago

  • Related to Bug #10565: Escape Characters show in Academic Interests on People Page added

#2 Updated by Boone Gorges 7 months ago

  • Status changed from New to Resolved

Found it! I was using a bad technique for converting an HTML string to a jQuery object. https://github.com/cuny-academic-commons/cac-advanced-profiles/commit/0c598048e01efa8663e1a05af57f3b157b2bddc5

Also available in: Atom PDF