DoctrineExtensions: [sortable] removing entities causes DQL error

When removing entities from sortable crashes, in sortableListener at line 328 with invalid SQL:

UPDATE SCMS\Entity\NewsArticlePhoto n SET n.position = n.position - 1 WHERE n.position >=  AND n.news_article = :val___0
array (size=3)
  'start' => null
  'stop' => int -1
  'delta' => int -1

tested on v2.3

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Reactions: 1
  • Comments: 24 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I had the same error. I could fix it with setting the default value of the position.

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

Terribly sorry about that, I forgot that we’re all here to serve you with perfect free software.