•  
      request #6486 Problem with non-valid "Date Field" criteria values in trackers report
    Infos
    #6486
    Ahmed HOSNI (hosniah)
    2014-03-26 08:52
    2014-03-18 14:21
    6561
    Details
    Problem with non-valid "Date Field" criteria values in trackers report

    In the tracker report when switching a given date field to advanced_mod, then you insert wrong input  (spaces, string,etc...) within start_date or end-date, the display of the report is broken and there is no way to see it again, since the non-valid criteria values are saved to the report:

    [Mon Mar 17 17:14:19 2014] [error] [client 10.157.12.182] PHP Notice:  DB error ==>
      SELECT GROUP_CONCAT(DISTINCT id) AS id, GROUP_CONCAT(DISTINCT last_changeset_id) AS last_changeset_id  
      FROM (SELECT c.artifact_id AS id, c.id AS last_changeset_id  FROM tracker_artifact AS artifact\n 
      INNER JOIN tracker_changeset AS c ON (artifact.last_changeset_id = c.id)
      INNER JOIN tracker_changeset_value AS A_376 ON (A_376.changeset_id = c.id AND A_376.field_id IN (376))\n   
      INNER JOIN tracker_changeset_value_list AS C_376 ON (\n    C_376.changeset_value_id = A_376.id\n    AND C_376.bindvalue_id IN(334)\n  ) \n
      INNER JOIN tracker_changeset_value AS A_379 \n
            ON (A_379.changeset_id = c.id \n  
            AND A_379.field_id = 379\n                     ) \n
            INNER JOIN tracker_changeset_value_list AS B_379 ON (B_379.changeset_value_id = A_379.id) \n \n 
            INNER JOIN tracker_changeset_value AS A_372 ON (A_372.changeset_id = c.id AND A_372.field_id IN (3 
            in /usr/share/codendi/src/common/dao/include/DataAccessObject.class.php on line 152, referer: http://crx19007.cro.st.com/plugins/tracker/?tracker=10

    [Mon Mar 17 17:14:19 2014] [error] [client 10.157.12.182] PHP Fatal error:  Call to a member function getRow() on a non-object in /usr/share/codendi/plugins/tracker/include/Tracker/Report/Tracker_Report.class.php on line 325, referer: http://crx19007.cro.st.com/plugins/tracker/?tracker=10

     

    Trackers
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Ahmed HOSNI (hosniah)
    Closed
    2014-03-26
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Merged in 6.11.99.32. Thanks for your contrib!

    • Status changed from New to Closed
    • Close date set to 2014-03-26
    User avatar
    You have to add Tuleap-Integrators group in reviewers if you want us to review your work. I'm adding it.
    User avatar
    Ahmed HOSNI (hosniah)2014-03-18 14:47

    The second issue is the PHP Fatal error in Tracker_Report::getMatchingIdsInDb().

    At the line 325,   we need to split this instruction:  $matching_ids = $dao->searchMatchingIds()->getRow();

    Then check if  $dao->searchMatchingIds() has returned a DataAccessResult Object or DataAccessResultEmpty Object before calling getRow()...

    User avatar
    Ahmed HOSNI (hosniah)2014-03-18 14:28
    last edited by: Ahmed HOSNI (hosniah) 2014-03-18 14:29

    The first issue to fix is the DB error in Tracker_FormElement_Field_Date::getSQLCompareDate() , which is due to malformed additional "Where" filter (Wrong BETWEEN statement) if the start_date is no set:

    WHERE artifact.tracker_id = 10 AND ( B_379.bindvalue_id = 106 )
        AND ( c.submitted_on BETWEEN AND 9223372036854775807 + 24 * 60 * 60 - 1 ) ) AS R