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

marcusx’s picture

Status: Active » Needs review
StatusFileSize
new4.6 KB

As 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.

damienmckenna’s picture

Title: Autocomplete, path_lookup, and admin link not working -> makes the module do nothing » Autocomplete, path_lookup, and admin link not working
Status: Needs review » Needs work

Thanks 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().

marcusx’s picture

Status: Needs work » Needs review
StatusFileSize
new6.08 KB

You 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.

damienmckenna’s picture

StatusFileSize
new1.97 KB

I 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.

damienmckenna’s picture

Issue tags: +#facepalm
StatusFileSize
new1.96 KB

Gah, that was the wrong patch.

damienmckenna’s picture

Status: Needs review » Fixed

I've committed this to both the 7.x-1.x and 7.x-2.x branches, thanks!

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