gyselroth / tubee

Data management engine with synchronization support
GNU General Public License v3.0
4 stars 4 forks source link

Add workflow with no data ends in Undefined index exception #44

Closed raffis closed 5 years ago

raffis commented 5 years ago

Describe the bug

[07-Jun-2019 06:18:26] WARNING: [pool www] child 465 said into stdout: "2019-07-06 06:18:26 [Tubee\Bootstrap\ContainerBuilder,DEBUG]: Undefined index: data in /usr/share/tubee/src/lib/Workflow/Factory.php:179  "
[07-Jun-2019 06:18:26] WARNING: [pool www] child 465 said into stdout: "2019-07-06 06:18:26 [Tubee\Rest\Middlewares\ExceptionHandler,ERROR]: uncaught exception Undefined index: data]  [object] (ErrorException(code: 0): Undefined index: data at /usr/share/tubee/src/lib/Workflow/Factory.php:179)"

To Reproduce

Add workflow without data field:

{
    "_id" : ObjectId("5cf927fa651dfc01da7ffc92"),
    "name" : "create-update",
    "secrets" : [ ],
    "kind" : "Workflow",
    "namespace" : "ns",
    "collection" : "accounts",
    "endpoint" : "im-mssql",
    "created" : ISODate("2019-06-06T14:49:30.296Z"),
    "changed" : ISODate("2019-06-06T14:49:30.296Z"),
    "version" : 1
}

Expected behavior

The default should be used for data. Or maybe data should be required since an empty data does not really make sense.

Environment

Additional context

Add any other context about the problem here.