•  
      request #13377 Retrieval of the first transition of the current state can crash if there is no changeset or the changeset value for the field does not exist
    Infos
    #13377
    Thomas Gerbet (tgerbet)
    2019-05-14 15:08
    2019-05-14 10:20
    14124
    Details
    Retrieval of the first transition of the current state can crash if there is no changeset or the changeset value for the field does not exist
    In some cases we might have no changeset value for a field (see for example this other issue: request #13376). If a workflow is enabled on this field, the retrieval of the workflow information might lead to a PHP fatal error.

    Even this situation is not supposed to happen, the code should take into account all possible values exposed by the internal API.



    Trace:
    PHP Fatal error: Uncaught Error: Call to a member function getValue() on null in /usr/share/tuleap/plugins/tracker/include/Workflow/Workflow.class.php:393"
    Stack trace:
    #0 /usr/share/tuleap/plugins/tracker/include/Workflow/PostAction/ReadOnly/ReadOnlyFieldDetector.php(46): Workflow->getFirstTransitionForCurrentState(Object(Tracker_Artifact))
    #1 /usr/share/tuleap/plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field.class.php(582): Tuleap\Tracker\Workflow\PostAction\ReadOnly\ReadOnlyFieldDetector->isFieldReadOnly(Object(Tracker_Artifact), Object(Tracker_FormElement_Field_Selectbox))"
    #2 /usr/share/tuleap/plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field.class.php(378): Tracker_FormElement_Field->fetchArtifactValueForWebDisplay(Object(Tracker_Artifact), Object(Tracker_Artifact_ChangesetValue_List), Array)
    #3 /usr/share/tuleap/plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Container.class.php(293): Tracker_FormElement_Field->fetchArtifa...
    Trackers
    11.0
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2019-05-14
    Attachments
    Empty
    References

    Follow-ups

    • User avatar
      Integrated into Tuleap 11.1.99.61

      • Status changed from Under review to Closed
      • Connected artifacts
      • Close date set to 2019-05-14
    • User avatar
      Thomas Gerbet (tgerbet)2019-05-14 11:29
      Fix can be reviewed here: gerrit #14961.

      • Summary
        -Retrieval of the first transition of the current state can crash if there is no changeset or the changeset for the field does not exist 
        +Retrieval of the first transition of the current state can crash if there is no changeset or the changeset value for the field does not exist 
      • Status changed from Under implementation to Under review