Merge pull request #14161 from annando/error

Fix " Call to undefined method Friendica\App::getLoggedInUserNickname"
This commit is contained in:
Hypolite Petovan 2024-05-15 07:56:56 -04:00 committed by GitHub
commit cad3a01b1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,14 +22,11 @@
namespace Friendica\Module\Calendar\Event;
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Model\Event;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
@ -46,17 +43,16 @@ class Get extends \Friendica\BaseModule
/** @var IHandleUserSessions */
protected $session;
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session;
$this->app = $app;
}
protected function rawContent(array $request = [])
{
$nickname = $this->parameters['nickname'] ?? $this->app->getLoggedInUserNickname();
$nickname = $this->parameters['nickname'] ?? $this->session->getLocalUserNickname();
if (!$nickname) {
throw new HTTPException\UnauthorizedException();
}