Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Sonata admin sortabe listing, fields are blank

$
0
0

Im trying to make a simple sortable system on one of my tables in the sonata admin bundle, i have followed this tutorial (https://symfony.com/doc/master/bundles/SonataAdminBundle/cookbook/recipe_sortable_listing.html#the-recipe) and yet Im not capable of doing it.

I have followed each of the steps carefully but on my admin table i can only see a blank action field, no arrows in it.

I have searched and searched throught articles but am not having any success, i feel like im very close to figure it out.

Here is my src/Entity/Podcast.php file

/**
* @Gedmo\SortablePosition
*@ORM\Column(name="position", type="integer")
*/
private $position;

//getters and setters 

public function setPosition($position)
{
  $this->position = $position;

  return $this;
}

public function getPosition()
{
  return $this->position;
}

As far as i know my entity file is just fine

my services.yaml file

  //Gedmo
  gedmo.listener.sortable:
    class: Gedmo\Sortable\SortableListener
    tags:
      - { name: doctrine.event_subscriber, connection: default }
    calls:
      - [ setAnnotationReader, [ "@annotation_reader" ] ]

//podcast admin
admin.podcast:
  class: App\Admin\PodcastAdmin
  tags:
    - name: sonata.admin
      manager_type: orm
      label: 'Programa'
      show_mosaic_button: true
  arguments:
    - ~
    - App\Entity\Podcast
    - 'PixSortableBehaviorBundle:SortableAdmin'
  calls:
     - [ setPositionService, ['@pix_sortable_behavior.position']]

my stof_doctrine_extension.yaml file

stof_doctrine_extensions:
default_locale: en_US
orm:
  default:
    sortable: true

And last but not least, my PodcastAdmin.php file

protected function configureRoutes(RouteCollection $collection)
{
  $collection->add('move', $this->getRouterIdParameter().'/move/{position}');
}

protected function configureListFields(ListMapper $listMapper) {
    $listMapper
    ->add('id')
    ->addIdentifier('title')
    ->add('description')
    ->add('author.name')
    ->add('_action', null, [
      'actions' => [
        'move' => [
          'template' => '@App/Admin/_sort.html.twig',
        ],
      ],
    ]);
}

As it right now im getting the following error There are no registered paths for namespace "App" in @SonataAdmin/CRUD/list__action.html.twig at line 17.

And if i switch the temmplate value to @PixSortableBehavior/Default/_sort.html.twig, im able to see the page but the action field is all blank, there are no arrows


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>