My site doesn't have clean url activated. The url of the site name gives a page not found error.

In wetkit/themes/wetkit_omega/preprocess/system/page.preprocess.inc
replacing

$variables['site_name_url'] = '/' . variable_get('site_frontpage', 'node');

by

$variables['site_name_url'] = url(variable_get('site_frontpage', 'node'));

solved my issue.

CommentFileSizeAuthor
#3 wetkit_omega-more_flexible_site_name_url-2168363-3.patch554 bytesAnonymous (not verified)
#3 default_front_page.png8.19 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

same problem happen when a site is installed in a subfolder as the code is hardcoding '/'. Here's a patch with the fix from #1, but with the command shortened as the parameters in url() are not required to get the homepage.

sylus’s picture

Don't see the patch?

Can you also confirm that when specifying a full url in 'Site information' page that that still works?

For instance http://www.google.com.

Anonymous’s picture

sorry, seems like d.o thought I was a spammer for a while and blocked me.

in Site Information, with the patch it's working if one enter "node/1" or something similar, not working if one enter "http://google.com", it's by design, as the help text for the "default front page" field state "specify a relative URL to display as the front page". Current code is not working either for a full url btw.

Side note, current code have the weird side effect of creating the link for the homepage as "example.com/en/node/1", when other links to on the website will link to "example.com/en/", thus having two different url for the same page. this is not happening with this simple patch

sylus’s picture

Status: Active » Needs work

Yeah I have problems with honeypot as well. ^_^

We did use to override this field so that an external url could be used but was never a fan of that.

I'd take this patch but what just a quick question.

Say a user wants to override the front page and assign it to node/6 in the site information page.

This would no longer work with the patch just specifiying url.

Maybe we can instead check if that variable is empty then assign url() so both scenarios work?

sylus’s picture

I am thinking about just using the following?

Can you confirm that this works for the problem mentioned here?

$variables['site_name_url'] = variable_get('site_frontpage', 'node');

I just took away the bracket, this is also how Drupal core handles this.

sylus’s picture

I have committed this as should fix clean url issue.

I'll this issue open for feedback.

Commit: http://drupalcode.org/project/wetkit_omega.git/commit/b357bac

sylus’s picture

Status: Needs work » Postponed (maintainer needs more info)
sylus’s picture

Status: Postponed (maintainer needs more info) » Needs review
sylus’s picture

Nevermind I had to use the first patch and wrap inside url();

Seems to work for all my testing.

Commit: http://drupalcode.org/project/wetkit_omega.git/commit/677730d

Anonymous’s picture

Thanks for the commit, these 3 lines are equivalent anyway and serving our project well

<?php
url(variable_get('site_frontpage', 'node'));
url('<front>');
url();
?>

setting something like "node/48" as the frontpage will work in all cases, as the function will return "example.com/en" and display the content of node/48 when the page is accessed.

sylus’s picture

Status: Needs review » Fixed

Ah I get what your saying now. Cool glad it works :)

Status: Fixed » Closed (fixed)

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