There's a bug with updating context. To reproduce:
Create a context without any tables/views
Save context
Edit context and add a table or view
Try to save. There's an error.
Error Trace
```json
"OCA\\Tables\\Controller\\ContextController",
"update",
[
"OC\\AppFramework\\DependencyInjection\\DIContainer"
],
[
"1",
"ocs.tables.context.update"
]
]
},
{
"file":"/var/www/html/ocs/v1.php",
"line":43,
"function":"match",
"class":"OC\\Route\\Router",
"type":"->",
"args":[
"/ocsapp/apps/tables/api/2/contexts/1"
]
},
{
"file":"/var/www/html/ocs/v2.php",
"line":7,
"args":[
"/var/www/html/ocs/v1.php"
],
"function":"require_once"
}
],
"File":"/var/www/html/apps/tables/lib/Db/PageContentMapper.php",
"Line":37
},
"message":"OCA\\Tables\\Db\\PageContentMapper::findByPageAndNodeRelation(): Argument #1 ($pageId) must be of type int, null given, called in /var/www/html/apps/tables/lib/Service/ContextService.php on line 365 in file '/var/www/html/apps/tables/lib/Db/PageContentMapper.php' line 37",
"exception":{
},
"CustomMessage":"OCA\\Tables\\Db\\PageContentMapper::findByPageAndNodeRelation(): Argument #1 ($pageId) must be of type int, null given, called in /var/www/html/apps/tables/lib/Service/ContextService.php on line 365 in file '/var/www/html/apps/tables/lib/Db/PageContentMapper.php' line 37"
}
}
```
The problem occured because there's no startpage inserted when an "empty" context without resources is created.
There's a bug with updating context. To reproduce:
Error Trace
```json "OCA\\Tables\\Controller\\ContextController", "update", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "1", "ocs.tables.context.update" ] ] }, { "file":"/var/www/html/ocs/v1.php", "line":43, "function":"match", "class":"OC\\Route\\Router", "type":"->", "args":[ "/ocsapp/apps/tables/api/2/contexts/1" ] }, { "file":"/var/www/html/ocs/v2.php", "line":7, "args":[ "/var/www/html/ocs/v1.php" ], "function":"require_once" } ], "File":"/var/www/html/apps/tables/lib/Db/PageContentMapper.php", "Line":37 }, "message":"OCA\\Tables\\Db\\PageContentMapper::findByPageAndNodeRelation(): Argument #1 ($pageId) must be of type int, null given, called in /var/www/html/apps/tables/lib/Service/ContextService.php on line 365 in file '/var/www/html/apps/tables/lib/Db/PageContentMapper.php' line 37", "exception":{ }, "CustomMessage":"OCA\\Tables\\Db\\PageContentMapper::findByPageAndNodeRelation(): Argument #1 ($pageId) must be of type int, null given, called in /var/www/html/apps/tables/lib/Service/ContextService.php on line 365 in file '/var/www/html/apps/tables/lib/Db/PageContentMapper.php' line 37" } } ```The problem occured because there's no startpage inserted when an "empty" context without resources is created.