Skip to content

Commit

Permalink
#9253 Fix URL in announcement API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Nov 8, 2023
1 parent 8a72e0f commit 17a9e6f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
6 changes: 0 additions & 6 deletions classes/announcement/maps/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ class Schema extends \PKP\core\maps\Schema

public string $schema = PKPSchemaService::SCHEMA_ANNOUNCEMENT;

public function __construct(Request $request, PKPSchemaService $schemaService)
{
$this->request = $request;
$this->schemaService = $schemaService;
}

/**
* Map an announcement
*
Expand Down
21 changes: 0 additions & 21 deletions classes/components/listPanels/PKPAnnouncementsListPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

namespace PKP\components\listPanels;

use APP\core\Application;
use PKP\context\Context;

class PKPAnnouncementsListPanel extends ListPanel
{
/** @var string URL to the API endpoint where items can be retrieved */
Expand All @@ -40,7 +37,6 @@ class PKPAnnouncementsListPanel extends ListPanel
*/
public function getConfig()
{
$request = Application::get()->getRequest();
return parent::getConfig() + [
'addAnnouncementLabel' => __('grid.action.addAnnouncement'),
'apiUrl' => $this->apiUrl,
Expand All @@ -50,23 +46,6 @@ public function getConfig()
'editAnnouncementLabel' => __('manager.announcements.edit'),
'form' => $this->form->getConfig(),
'itemsMax' => $this->itemsMax,
'urlBase' => $this->getUrlBase()
];
}

protected function getUrlBase(): string
{
$request = Application::get()->getRequest();

return $request->getDispatcher()->url(
$request,
Application::ROUTE_PAGE,
$this->form->context
? $request->getContext()->getPath()
: 'index',
'announcement',
'view',
'__id__'
);
}
}

0 comments on commit 17a9e6f

Please sign in to comment.