It would be really nice if you could add a page description of the existing path when picking the parent for a node. The problem is I have my site split up to where there would be multiple pages with the same name, but under different nodes (ex. xbox 360 > games, ps3 > games. two nodes named games). So then when I go to add another one I've got a bunch of nodes with the same name in the dropdown menu and I have no clue how to tell them apart so I know which one to put it in.

Comments

ronan’s picture

Yeah.. this is a real problem with the pulldown for picking parent (apart from the potential scalability issues). I'm going to have to find a better solution for this. I'll post to this issue when I come up with something that works better.

Thanks for the feedback
Ronan

ronan’s picture

Status: Active » Fixed

The latest dev has hierarchical parent selectors. This should make it a lot easier to figure out which is which.

Let me know if it works for you and if you have any problems with this version.

GameCollision’s picture

Uh oh, just upgraded and now the whole thing isn't working. It no longer shows any nodes in the dropdown menu...

ronan’s picture

That's not good. I'll try to get that taken care of asap or at least revert back to the last version before the end of the day.

r

ronan’s picture

Status: Fixed » Needs work
StatusFileSize
new2.57 KB

I've rolled back the changes, so grab the latest snapshot as soon as it's available. Sorry about that.

I've added my changes to this thread as a patch so if anybody has some time to test it out and let me know if they can reproduce the bug mentioned in #3 above I'd really appreciate it. This is a feature I'd really like to get into version 1 of this module.

thanks

isaac.niebeling’s picture

I can verify that I see the same problem as #3--the super admin account can still see all the nodes in the parent dropdown, but no other roles can, no matter their permissions.

ronan’s picture

I can verify that I see the same problem as #3--the super admin account can still see all the nodes in the parent dropdown, but no other roles can, no matter their permissions.

Is this with the above patch applied or a clean install of the module?

isaac.niebeling’s picture

On a clean install, the dropdown shows up fine, with all the nodes listed--but without any indication of where in the hierarchy a given node is. Once patched, the dropdown shows up fine for the super admin account, with the hierarchical notation, but is empty (except for "-- NONE --") for all other users who should have access to it.

ronan’s picture

Great, thanks for helping test the patch, i'll see if I can find a fix for this as soon as I can

isaac.niebeling’s picture

Thanks--I appreciate it greatly.

isaac.niebeling’s picture

I did a little digging today, and while I'm not entirely familiar with how everything is interacting, I'm pretty certain that the issue is the changed SQL call--in the patch, you "SELECT h.nid, n.title", and without the patch, you "SELECT *". When only pulling the nids, the return value for node_access( 'update', $hierarchylist ) is null, so the items are never entered into the array to build the select list from.

On my test install, changing the SQL call back to SELECT * seemed to fix the problem. Thing is, my return values ended up not being 0/1 or true/false, or even null/1, but null, 1, or 2. Here's where my total ignorance starts kicking in--there's only two places in node_access where it's not directly returning true or false, and that's when it's returning $access or (db_result($result)). And I don't really understand what it's calling or why in those cases.

Anyway, the short version is that changing the SQL call seems to fix it, but might have other unintended consequences. Someone with more familiarity with Drupal could probably help answer that question.

Thanks,

Isaac

ronan’s picture

Status: Needs work » Needs review
StatusFileSize
new2.55 KB

That seems to work, thanks for finding that. The reason this is needed is that node_access requires a few other pieces of info (such as author's ID and status) in order to function. I forgot about that when I wrote this new code and neglected to test it with non-user 1 users. (I really need to write automated testing for this module).

As to why node_access returns positive integers in some cases, is due to the fact that the sql it uses to check for grants in the db, is counting the existing grants and simply returning the result. If there are 1 or more grants for the given user for the given node, then the user is considered to have access to that node.

I have rolled a new patch with your changes and will apply the patch to HEAD and maybe even the 1.x branches if it checks out.

Thanks again for the fix

isaac.niebeling’s picture

Glad I could help, and thanks for the info on how the grants return value worked. I've applied the patch and will keep an eye out for any other issues.

ronan’s picture

Status: Needs review » Fixed

This patch has been committed to 5.x.1.x-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.