Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Cart/checkout
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 May 2013 at 20:38 UTC
Updated:
30 Oct 2013 at 08:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
tr commentedAs far as I can see, the code is correct - the link is generated by url('user'), no reference to "drupal" in there ...
Do you have Drupal installed in a "drupal" subdirectory?
Comment #2
DanZ commentedIt isn't in a subdirectory. However, the development system I used did have it in a subdirectory. I moved the database from the development host to the production host. I guess the message was created on install and didn't change when it got moved.
Maybe the [user:url] or [site:login-link] or [site:login-url] token could solve this problem.
Comment #3
DanZ commentedComment #4
tr commentedYes, that would probably work. The problem is that the message, along with the substituted placeholder !user_url, is stored in the variable table in your database. When you move the database you copy the message value, which includes the different path you used on your development system. I suspect there are a number of other related problems you'll encounter because of this, not just with Ubercart variables either. The Drupal variable system really isn't designed for moving the database, or for translation, among other things.
Comment #5
longwaveChanging !user_url to a token initially sounds like a good idea, but then you run into problems with translations: #1535316: Can't translate "Return to the front page" or other strings containing links to tokens
There is no straightforward solution to this while Drupal core disallows certain characters from translation strings. One possible workaround is to keep !user_url in the original string (so it can be translated), replace it with [site:login-link] in t() (so it is tokenized but the full URL is not stored permanently), then replace the token at display time (so the URL is dynamically generated as needed).
Comment #6
longwaveThe attached patch uses the [site:login-url] token instead of url('user').
Comment #8
longwaveTestbot ran out of disk space.
#6: 1991394-checkout-message-login-link.patch queued for re-testing.
Comment #9
longwaveCommitted.