Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5847993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:47:50+00:00 2026-05-22T12:47:50+00:00

I have been looking at nestedSet behaviour in symfony using doctrine, to display a

  • 0

I have been looking at nestedSet behaviour in symfony using doctrine, to display a nestedSet hierachy in an admin module for my CMS.

I have come across: http://redotheoffice.com/?tag=doctrine-drag-drop-admin-generator-symfony-nestedset which at first glance looked great and I have now implemented this.

My problem comes with trying to order root nodes, since they are organised by root_id, which this implementation does not do.

I have found the following: http://blog.rajatpandit.com/2010/03/27/ordering-list-of-items-doctrine-symfony-1-4/ but I have already created a custom template to render the drag/drop nestedSet, so I’m trying to use this.

//generator.yml
        object_actions:
      new:
      _edit:    ~
      _delete:  ~
      moveUp:
      moveDown:

I’ve copied over the code into my actions.class.php and my model classes form the link above.

When trying to move a node up or down it throws an error on: $this->current_report->getId(), in executeUp() and executeDown()

Fatal error: Call to a member function getId() on a non-object

If I then try to create the current_report object using $this->current_report = new Tree(), i then get another error:

Fatal error: Call to a member function setPosition() on a non-object this is in my Tree.class.php file and the method is swapWith()

Position is the field I’m using to sort by rather than root_id.

If someone could help me with this, I’d muchly appreciate it.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:47:51+00:00Added an answer on May 22, 2026 at 12:47 pm

    You cannot re-order root nodes using Doctrine Nested Sets.

    If you need to do this, you can do the same thing that I did and create a fake root node level. The idea is that level 0 will be your “fake root” node level, and your “real root” nodes start at level 1.

    In this manner, you are able to re-order the fake root nodes, and it is not noticeable by a user if done correctly.

    My implementation of this technique is demonstrated here: http://cart.samedraw.com/cartadmin/categoryIndex

    Source code available at github: https://github.com/jongallant/sfCartPlugin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking over the web but have not come across an answer
I have been looking through to Open Graph documentation and I haven't come across
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been looking through some MFC code and i came across this expression.
I have been looking at how I could use Single linked lists using the
I have been looking for some examples and solutions using the jquery-datatables-editable plugin and
I have been looking around for solutions, and tried to implement what is often
I have been looking into CruiseControl configuration recently (I'm a complete CC noob) and
I have been looking at many ASP.Net MVC client side validation ideas including xVal.
I have been looking to implement a custom class of : IList<ArraySegment<byte>> this will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.