nextcloud/related_resources

Typed property TalkRoom::$entity must not be accessed before initialization in file TalkRoom.php line 160

nickvergessen opened this issue · 2 comments

{
  "reqId": "zWQUg7VN3VTww1Yp1swt",
  "level": 3,
  "time": "2022-10-13T20:53:33+00:00",
  "remoteAddr": "",
  "user": "",
  "app": "no app in context",
  "method": "GET",
  "url": "/ocs/v2.php/apps/related_resources/related/talk/***token***?format=json",
  "message": "Typed property OCA\\RelatedResources\\Model\\TalkRoom::$entity must not be accessed before initialization in file …/apps/related_resources/lib/Model/TalkRoom.php line 160",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0",
  "version": "25.0.0.16",
  "exception": {
    "Exception": "Exception",
    "Message": "Typed property OCA\\RelatedResources\\Model\\TalkRoom::$entity must not be accessed before initialization in file …/apps/related_resources/lib/Model/TalkRoom.php line 160",
    "Code": 0,
    "Trace": [
      {
        "file": "…/lib/private/AppFramework/App.php",
        "line": 172,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\RelatedResources\\Controller\\ApiController"
          },
          "getRelatedResources"
        ]
      },
      {
        "file": "…/lib/private/Route/Router.php",
        "line": 298,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\RelatedResources\\Controller\\ApiController",
          "getRelatedResources",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          [
            "talk",
            "***token***",
            "ocs.related_resources.Api.getRelatedResources"
          ]
        ]
      },
      {
        "file": "…/ocs/v1.php",
        "line": 63,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/ocsapp/apps/related_resources/related/talk/***token***"
        ]
      },
      {
        "file": "…/ocs/v2.php",
        "line": 23,
        "args": [
          "…/ocs/v1.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "…/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 165,
    "Previous": {
      "Exception": "Error",
      "Message": "Typed property OCA\\RelatedResources\\Model\\TalkRoom::$entity must not be accessed before initialization",
      "Code": 0,
      "Trace": [
        {
          "file": "…/apps/related_resources/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php",
          "line": 92,
          "function": "getEntity",
          "class": "OCA\\RelatedResources\\Model\\TalkRoom",
          "type": "->",
          "args": []
        },
        {
          "function": "OCA\\RelatedResources\\RelatedResourceProviders\\{closure}",
          "class": "OCA\\RelatedResources\\RelatedResourceProviders\\TalkRelatedResourceProvider",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "…/apps/related_resources/lib/RelatedResourceProviders/TalkRelatedResourceProvider.php",
          "line": 91,
          "function": "array_map",
          "args": [
            {
              "__class__": "Closure"
            },
            [
              "*** sensitive parameters replaced ***",
              {
                "__class__": "OCA\\RelatedResources\\Model\\TalkRoom"
              },
              {
                "__class__": "OCA\\RelatedResources\\Model\\TalkRoom"
              },
              {
                "__class__": "OCA\\RelatedResources\\Model\\TalkRoom"
              },
              {
                "__class__": "OCA\\RelatedResources\\Model\\TalkRoom"
              },
              "And 4 more entries, set log level to debug to see all entries"
            ]
          ]
        },
        {
          "file": "…/apps/related_resources/lib/Service/RelatedService.php",
          "line": 210,
          "function": "getSharesRecipients",
          "class": "OCA\\RelatedResources\\RelatedResourceProviders\\TalkRelatedResourceProvider",
          "type": "->",
          "args": [
            "***token2***"
          ]
        },
        {
          "file": "…/apps/related_resources/lib/Service/RelatedService.php",
          "line": 153,
          "function": "getSharesRecipients",
          "class": "OCA\\RelatedResources\\Service\\RelatedService",
          "type": "->",
          "args": [
            "talk",
            "***token2***"
          ]
        },
        {
          "file": "…/apps/related_resources/lib/Service/RelatedService.php",
          "line": 109,
          "function": "retrieveRelatedToItem",
          "class": "OCA\\RelatedResources\\Service\\RelatedService",
          "type": "->",
          "args": [
            "talk",
            "***token***"
          ]
        },
        {
          "file": "…/apps/related_resources/lib/Controller/ApiController.php",
          "line": 101,
          "function": "getRelatedToItem",
          "class": "OCA\\RelatedResources\\Service\\RelatedService",
          "type": "->",
          "args": [
            "talk",
            "***token***",
            7
          ]
        },
        {
          "file": "…/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 225,
          "function": "getRelatedResources",
          "class": "OCA\\RelatedResources\\Controller\\ApiController",
          "type": "->",
          "args": [
            "talk",
            "***token***"
          ]
        },
        {
          "file": "…/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 133,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\RelatedResources\\Controller\\ApiController"
            },
            "getRelatedResources"
          ]
        },
        {
          "file": "…/lib/private/AppFramework/App.php",
          "line": 172,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\RelatedResources\\Controller\\ApiController"
            },
            "getRelatedResources"
          ]
        },
        {
          "file": "…/lib/private/Route/Router.php",
          "line": 298,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OCA\\RelatedResources\\Controller\\ApiController",
            "getRelatedResources",
            {
              "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            },
            [
              "talk",
              "***token***",
              "ocs.related_resources.Api.getRelatedResources"
            ]
          ]
        },
        {
          "file": "…/ocs/v1.php",
          "line": 63,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/ocsapp/apps/related_resources/related/talk/***token***"
          ]
        },
        {
          "file": "…/ocs/v2.php",
          "line": 23,
          "args": [
            "…/ocs/v1.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "…/apps/related_resources/lib/Model/TalkRoom.php",
      "Line": 160
    },
    "CustomMessage": "--"
  },
  "id": "63487ad094b1b"
}

cc @ArtificialOwl

is this on rc4 ? it should already be fixed:

private ?FederatedUser $entity = null;

my bad: #87