Skip to content

Commit

Permalink
Fix Error on delete RssFeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
RemyNovactive committed Feb 8, 2024
1 parent e42cfa6 commit d7fcace
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 6 additions & 4 deletions src/bundle/Controller/Admin/RssFeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ public function getNotificationHandler(): NotificationHandlerInterface

/**
* @Route("/delete/{id}", name="platform_admin_ui_rss_feeds_delete")
* @ParamConverter("rssFeed", class="Novactive\EzRssFeedBundle\Entity\RssFeeds")
*/
public function deleteAction(Request $request, RssFeeds $rssFeed): RedirectResponse
public function deleteAction(Request $request, int $id): RedirectResponse
{
$rssFeedRepository = $this->entityManager->getRepository(RssFeeds::class);
$rssFeed = $rssFeedRepository->find($id);

/**
* @var PermissionResolver
*/
Expand Down Expand Up @@ -289,8 +291,8 @@ public function getAjaxFieldByContentTypeIdAction(Request $request): JsonRespons

if ($request->get('contenttype_id')) {
$contentType = $this->getRepository()
->getContentTypeService()
->loadContentType($request->get('contenttype_id'));
->getContentTypeService()
->loadContentType($request->get('contenttype_id'));

foreach ($contentType->getFieldDefinitions() as $fieldDefinition) {
$fieldsMap[ucfirst($fieldDefinition->getName())] =
Expand Down
12 changes: 0 additions & 12 deletions src/bundle/Resources/views/themes/admin/rssfeed/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,6 @@
<tbody class="ibexa-table__body">
{% for rss in pager.currentPageResults %}
<tr id="{{ 'rssfeed-' ~ rss.urlSlug }}" class="ibexa-table__row">
{# STATUS_ENABLED=1 STATUS_DISABLED=0 #}
{% set statusString = 'UNKNOW' %}
{% set statusCOLOR = 'gray' %}
{% if rss.status == 0 %}
{% set statusString = 'DISABLED' %}
{% set statusCOLOR = 'orange' %}
{% endif %}
{% if rss.status == 1 %}
{% set statusString = 'ENABLED' %}
{% set statusCOLOR = 'green' %}
{% endif %}
<td class="ibexa-table__cell"><span style="color: {{ statusCOLOR }}">{{ statusString }}</span></td>
<td class="ibexa-table__cell" title="{{ rss.description|escape('html_attr') }}">{{ rss.title }}</td>
<td class="ibexa-table__cell"><a href="/rss/feed/{{ rss.urlSlug }}" target="_blank">{{ rss.urlSlug }}</a></td>
<td class="ibexa-table__cell">{{ rss.createdAt|date("d/m/Y H:i") }}</td>
Expand Down

0 comments on commit d7fcace

Please sign in to comment.