I don't mind that node_user reassigns all nodes for a deleted user to anonymous, but it needs to let all the other users of hook_user('delete') get their shot at the nodes first. Somehow it needs to change its own weight to very high (e.g. 999). I have to set my module's weight to -1 to make sure it runs before node.module, so now Taxonomy Super Select doesn't work with it because it has to run higher than taxonomy.module. Oh what a wicked web we weave!

CommentFileSizeAuthor
#2 node_user.patch939 bytesbleen

Comments

nancydru’s picture

1) This was discovered on a 6.10 system, so it would be nice if the solution could be back-ported.

2) Does anyone know if it is safe to increase the weight of the node module?

bleen’s picture

Status: Active » Needs review
StatusFileSize
new939 bytes

I think we can leverage #692950: Use hook_module_implements_alter to allow modules to alter the weight of hooks in module_implements here ...

on the other hand, contrib modules can leverage #692950: Use hook_module_implements_alter to allow modules to alter the weight of hooks in module_implements just as easily, so we may just want to let them do that. That might be preferable, but if not this patch should do it

This wont backport very well in any event...

moshe weitzman’s picture

what exactly is the bug in d7 that we are fixing here? the hooks fire before the user table entries get removed.

nancydru’s picture

@Moshe: I don't believe that is entirely true in 6.x; I have not looked at this in 7.x yet. Node_user deletes them when it gets called, so any module that runs after node doesn't have a chance to do anything. The problem I had when I reported this is that the Web Links module wanted the opportunity to re-assign the nodes to someone else, but my customer also wanted to use Hierarchical Select. Setting Web Links weight to -1 allowed it to catch the nodes before node_user deleted them, but that meant the HS couldn't be used because Taxonomy hadn't run yet. #692950 may very well fix this; I just don't have the time to set up a test on this and WL hasn't been converted to 7.x yet.

thedavidmeister’s picture

Version: 7.x-dev » 6.x-dev
Issue summary: View changes
Status: Needs review » Closed (won't fix)

node_user() no longer appears to be in d7, whatever it was doing, i presume the fix might have been to leverage a queue for cleanup tasks rather than weight juggle.

As hook_module_implements_alter() does not exist in d6 and simply changing the weight globally would be an API change, I think this becomes a "won't fix".