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

dateClause() in Form.php doesn't add table reference to field

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.6
    • Fix Version/s: 4.4.0
    • Component/s: CiviReport
    • Labels:
      None

      Description

      When making a custom report, the SQL would error because the field 'end_date' in the WHERE clause did not have a table alias appended to it, so the system could not decide which 'end_date' was being referenced. It appears the dateClause() function in Form.php (lines 1261 to 1268) is the culprit.

      I was able to get around it by including the table alias in the fieldName string passed in, but this only fixes it for this particular custom report.. it will still occur if anyone uses any of the current reports as a template. It would seem to make sense to have dateClause() provide this functionality, as it has access to the information.

      I can work on a fix for this, as it seems straightforward, but I wanted to check whether it was fixed in a future version (from 4.2.6) already first.

        Attachments

          Activity

            People

            • Assignee:
              deepak Deepak Srivastava
              Reporter:
              duwease Rob Williams
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: