Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16982

Handled odd custom values in search or remove them

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.6
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      This is a follow on from https://issues.civicrm.org/jira/browse/CRM-16961

      The issue in that ticket arose because people were saving option values like 'brackets are cool(ish)' and the brackets were being saved to both label field (good) and name field (bad). Name is expected really to be a machine name & putting non alphanumeric (plus a whitelist of things like _) opens us up to have to do complex code solutions.

      The issue in CRM-16961 was resolved specifically WRT parentheses, but, in discussion with Monish, we realised it could apply to a bunch of other characters including '+' which have a special meaning in regex.

      We discussed 3 options
      1) merge the patch that fixed it for parentheses
      2) back out of the regex checking
      3) replace all 'not-ok' characters in the option_value.name field (at least for custom value option fields) & ensure they are stripped on save (with or without UI notification - since more users never even think about that field).

      As a short-term fix #1 has happened. Longer term either #2 or #3 or both probably need to happen. I'll ping monish to comment on the history & reasons for regex but #3 would probably save us from headaches we haven't even thought about yet.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: