Comments

Liam Morland created an issue. See original summary.

bharath-kondeti’s picture

Assigned: Unassigned » bharath-kondeti
StatusFileSize
new912 bytes

I have created this patch for Drupal 7.67 version. Can you please test the patch

liam morland’s picture

Thanks for the patch. I don't think check_plain() is needed. The return value of base_path() is always plain text.

The patch did not apply. It needs to be created using Git.

It is best to get it to pass on one test before queuing up any more.

bharath-kondeti’s picture

Hi Liam, Thank you for response. I will work on the suggestions provided and resubmit a new patch.

bharath-kondeti’s picture

StatusFileSize
new863 bytes

Liam, i have created the patch on comment#2 from git itself. But, i have created that patch on tokens module instead of Drupal core as mentioned in the Issue meta data. Even the log shows error: token.tokens.inc: No such file or directory.

Now, I have created a new patch file with changes made to drupal's core system module file.

longwave’s picture

What is this token useful for, as opposed to site:url? Drupal 8 does not have this token and so it is very unlikely this will be added to Drupal 7 first.

liam morland’s picture

This is useful for making relative URLs in the site. This is often preferable to fully-qualified URLs.

Perhaps this should be moved to the token module queue, then the patch in #2 would work.

liam morland’s picture

Project: Drupal core » Token
Version: 7.x-dev » 7.x-1.x-dev
Component: token system » Token Actions
bharath-kondeti’s picture

StatusFileSize
new787 bytes

Liam, I have made changes to patch on comment#2. I have removed check_plain(). I have added the changes in token module and uploading the new patch here. Can you please review the same.

liam morland’s picture

Thanks for the patch. Replace base_path funtion with base_path() function.

We probably need a D8 version of this patch as well.

bharath-kondeti’s picture

StatusFileSize
new472 bytes

I have made correction and uploading the patch.

I will work on the D8 patch as well. Can you please create a new issue for the same.

liam morland’s picture

This needs to be the full patch. Drupal tests the patches individually against the current development version.

Thinking about it again, I think the description should be different. It should be meaningful to someone who doesn't know anything about the functions. It could be "The file path to the homepage of your site." Perhaps the description should call base_path() so that the user can see what they will be getting.

liam morland’s picture

Status: Active » Needs review
StatusFileSize
new852 bytes
liam morland’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
StatusFileSize
new837 bytes

D8 version.

lisotton’s picture

Status: Needs review » Reviewed & tested by the community

I tested #14 and is working fine.
Moving to RTBC.

berdir’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review

There is an existing core issue for this for Drupal 8, use that: #1088112: Introduce a token to get site's base URL

liam morland’s picture

Patch for D7 in #13.