Hi guys!
I was quite happy that you came up with this module that would do exactly what I needed, but it isn't working at all.
I had to fix several things to got it working. I will send you a patch right away and explain further as soon as I got an issue number after this post.
It is about:
- not working with an autocomplete filed for node references
- not looking up the path
- not providing the correct link in the admin message
regards
mx
Comments
Comment #1
marcusx commentedAs you can see in the patch (commit comments) I had to change some things to get it working with node reference fields.
The first thing was that I used an autocomplete widget to define my redirect destination which had no matching case in the switch structure.
Than the lookup of the path was always coming back empty from drupal_lookup_path. (If you want to use it instead of drupal_get_path_alias there is still an argument missing.
Finally the link in the admin message missed an "/" on the beginning to make it working and not just putting it on the end of the current page.
Hopefully this helps to make the module better. Thanks for your work.
regards
Marcus
P.S.:
@todo: I think we have to check for other widget names like user_reference_autocomplete as well but I didn't look into this.
Comment #2
damienmckennaThanks for finding those bugs. One small change request - you should not just prefix the path with a slash, it should instead be prefixed by base_path().
Comment #3
marcusx commentedYou are right. Added base_path() to path instead of changing the string in the t() of the message box. Which was a bad idea also as a translation would break.
New version enclosed.
Comment #4
damienmckennaI re-rolled your patch and simplified it a little: I merged the two noderef cases, added a userref case & merged it with the other one, and added the base_path() call within drupal_set_message() rather adding a whole extra variable just for it.
Comment #5
damienmckennaGah, that was the wrong patch.
Comment #6
damienmckennaI've committed this to both the 7.x-1.x and 7.x-2.x branches, thanks!