•  
      request #23384 Importing a tracker with a simple workflow with no states raises a warning
    Infos
    #23384
    Thomas Gerbet (tgerbet)
    2021-09-30 17:24
    2021-09-28 10:06
    24929
    Details
    Importing a tracker with a simple workflow with no states raises a warning

    A simple worflow might have no states:

    simpleWorkflow =
        element simple_workflow {
            element field_id {
                attribute REF { xsd:IDREF }
            }?,
            element is_used {xsd:long}?,
            element states {
                element state {
                    element to_id {
                        attribute REF { xsd:string }
                    },
                    element transitions {
                        element transition {
                            element from_id {
                                attribute REF { xsd:string }
                            }
                        }+
                    }?,
                    simplePostActionsContent,
                    preConditionsContent
                }+
            }?
        }?
    

    The code does not handle that and a warning is raised if you try to import a workflow that does not have a states tag.

    PHP Warning:  foreach() argument must be of type array|object, null given in /usr/share/tuleap/plugins/tracker/include/Workflow/WorkflowFactory.class.php on line 384
    
    Trackers
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2021-09-30
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2021-09-28 10:08

    Patch under review: gerrit #24093.


    • Summary
      -Importing a tracker with a simple workflow with no state raises a warning 
      +Importing a tracker with a simple workflow with no states raises a warning 
    • Status changed from Under implementation to Under review