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

inline edit: address custom date fields break form load

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.6
    • Fix Version/s: 4.2.7
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      create a custom field of type date, attached to addresses
      view the address and click the inline block edit link
      result: form hangs on load

      can be tested here:
      http://sandbox.drupal.civicrm.org/civicrm/contact/view?reset=1&cid=125&context=search

      the problem is with CRM_Contact_Form_Edit_Address::buildQuickForm()
      where we set default values for custom fields, we have the following:
      @eval("\${$key} = " .$val . ";" );

      if changed to:
      @eval("\${$key} = '" .$val . "';" );

      it fixes the issue (difficult to see above, but we're wrapping $val in single quotes). I believe this happens because there are backslashes in the date, and so when php evals, it doesn't treat those like a string value.

      that said –
      the logic in that whole block seems pretty messed up. we retrieve defaults, then we cycle through the values and run the eval statement above, but then we set the defaults array to an empty address array variable. so I'm not sure why we're even cycling through the values.

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m