Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: insert context startpage for proper update #1146

Merged
merged 2 commits into from
Jun 17, 2024
Merged

fix: insert context startpage for proper update #1146

merged 2 commits into from
Jun 17, 2024

Conversation

enjeck
Copy link
Contributor

@enjeck enjeck commented Jun 16, 2024

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
                "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.

@enjeck enjeck force-pushed the add-startpage branch 3 times, most recently from 0a7aae1 to dafce43 Compare June 16, 2024 13:25
@juliushaertl juliushaertl requested a review from blizzz June 17, 2024 05:02
@enjeck
Copy link
Contributor Author

enjeck commented Jun 17, 2024

An error comes up when a new context without any resources is created

foreach() argument must be of type array|object, null given at /var/www/html/apps/tables/lib/Service/ContextService.php#433"

@enjeck enjeck marked this pull request as draft June 17, 2024 11:06
@enjeck enjeck marked this pull request as ready for review June 17, 2024 12:03
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
@blizzz blizzz merged commit 3658c66 into main Jun 17, 2024
58 checks passed
@blizzz blizzz deleted the add-startpage branch June 17, 2024 21:03
@enjeck enjeck self-assigned this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants