Site hierarchy doesn't populate the drop down
adrianjacob - May 13, 2008 - 16:31
| Project: | Node Hierarchy |
| Version: | 5.x-1.0 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | dgorton |
| Status: | postponed (maintainer needs more info) |
Description
Hi all,
Odd one this as I have used this module in previous projects (although previous to Drupal 5.7) and had no problems. I dont know if it's a 5.7 specific issue but after I install the module, the 'Default Parent' drop down box which is usually populated with my sites folders/hierarchy is empty (well, all it has is "--NONE --"). This is most frustrating and I have no idea why, can anybode help?
I need to make a few content types have a particular parent item.
Ta
| Attachment | Size |
|---|---|
| node-hierarchy.gif | 14.77 KB |

#1
#2
You'll need to make sure that you have some content types configured as 'Can be Parent' in admin/settings/nodehierarchy (or in the content types themselves).
Can you confirm that you've set that up?
#3
Thanks for the quick response.
I have already tried that im afraid. Still nothing in the drop down :(
#4
Hmmm. I don't have an easy answer, then.
I can confirm that this works on lots of 5.7 sites just fine. Are you error logs showing anything at all?
Do you have a clean Drupal 5.7 install you can test against? Have you tried switching to the nodehierarchy 5.x-1.x-dev version (or from it to 1.0)? What other modules do you have installed? You may want to try disabling everything non-core and then see if it works, especially anything else that might have to do with hierarchy...
#5
I cant see anything meaningful in the logs.
The site isnt a clean install anymore im afraid, quite a few other modules installed, but as I think i mentioned, I have run this on 5.7 before. Maybe in this new project there is a unique module I havent got in any other project, I will have to check.
I havent tried the dev version yet either, I will give it a go and let you know the results.
#6
Do you have any access control modules installed? It shouldn't make a difference if you're in with UID1, but if the user doesn't have update rights to content, I don't think it shows up in the list. Also, depending on what version you're using, you might want to check out the patch in #228448: Page Description (for multiple pages with the same title).
Isaac
#7
I shall have a look at that patch.
I can confirm that (just to add to the wierdness) uninstalling literally all modules didnt help, neither did 5.x-1.x-dev :(
Im beginning to wonder if its more of a site wide problem as looking at 'Content Management > Site Outline', i dont have the ability to dig down the site map like i do with other sites (see gif)
#8
#9
Hi Subscribing, having the same situation.
I made one contentytpe Parent: Country, One contenttype parent and child: Area and one contenttype child: Village.
The Parent of Village and Area is not filled..there is only stated: --None--
I think: http://drupal.org/node/258001 is also a duplicate.
Thanks for going into this.
I am in the site as UI1.
Greetings,
Martijn
#10
Hi: I had a similar problem and finally fixed it with a lot of manual work. It drove me crazy and couldn't find anything on it, so I am entering this to save others the frustration that I had.
The source of the problem was that for some mysterious reason, parent rows were lost in the nodehierarchy sql table. The table still had my hierarchy (or most of it) where parent nodes were set to anything but "0", but it lost many top level parent entries, that is, with parent node is set to "0". In our site, most rows didn't have parents because blog posts don't have parents.
If you have a backup of that table, replace the current table with the old version. If you don't have a backup (my backups are weekly and I didn't find out problem until after a week), you can do the following.
The manual fix was:
1. I saved out the existing table from phpMyAdmin as a CSV file to capture site hierarchy that was there (select your drupal database, then the table nodehierarchy, then the Export tab, click CSV up top, and Save as File at bottom).
2. I uninstalled and reinstalled nodeheirarchy module, which recreates the nodehierarchy table with all node set to a parent of zero (note: it does this even for node types not in hierarchy, which is why Site Outliner is useless for sites like ours where we have a thousands of blog posts, which are not hierarchical, and pages of permanent material which is, another gripe...). After you do this, your will see everything as parent again, but your site structure will be lost. Don't worry, we will fix that next.
3. I then edited the saved cvs file in excel. I quickly deleted all rows with parent of zero (last column, means that no hierarchy is set) and rearranged the columns from the tables nid, parent, order_by order to the new order of parent, order_by, nid (explain why in a second). I then inserted columns containing the values "a" "b" "c" "d" before, between, and after these columns (again, will explain why) in all the rows. Then I saved again as a csv file.
Example of initial nid, parent, order_by structure of all rows in table: 1000,2,100
Example of ending structure of same row: a,100,b,2,c,1000,d
4. I then edited the resulting file in a simple text editor (wordpad) in the following way (don't miss the little single quotes that have to surround all values):
a. globally replaced "a," with "UPDATE nodehierarchy SET parent = '"
b. globally replaced ",b," with "', order_by = '"
c. globally replaced ",c," with "' WHERE nid = '"
c. globally replaced ",d" with "';'"
So the final row looks like this:
UPDATE nodehierarchy SET parent = '100', order_by = '2' WHERE nid = '1000';
This means that each row with hierarchy information has been converted from:
This: 1000,2,100
To: a,100,b,2,c,1000,d
To: UPDATE nodehierarchy SET parent = '100', order_by = '2' WHERE nid = '1000';
So you now have a file that is a SQL table update file instead of a data save.
5. Cut the contents of the file and paste into phpMyAdmin under SQL in the box that says, Run SQL query. Hit Go.
This will put all of your site structure information back into the table.
#11
Thanks for sharing this solution. I'm sorry you had so much trouble with this. If anybody else experiences this issue and can figure out why please let me know and I'll look into a fix.
Also, the first version of nh did not store info for stuff with no parents (which made the site outline better, but had other downsides). Update #1 adds 0 as a default parent for all items with no nh entries, so forcing update 1 to run via update.php might help recover top level items if they go missing.
Thanks again
Ronan