Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
From drupal_is_front_page():
$is_front_page = ($_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node')));
Couldn't we store the normal path in the variable in the first place? I cannot see any use case where you would like the variable to contain a path alias.
Comment | File | Size | Author |
---|---|---|---|
#25 | path-front-page-D6.patch | 2.71 KB | rdrh555 |
#18 | fix_head.patch | 722 bytes | cweagans |
#13 | drupal.path-front-page.13.patch | 5.69 KB | sun |
#9 | drupal.path-front-page.9.patch | 5.69 KB | sun |
#8 | drupal.path-front-page.8.patch | 2.99 KB | sun |
Comments
Comment #1
Dave ReidWe normalize menu paths on saving but display aliases, so why not do the same here.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedsite_frontpage is really an internal path. There is no need to try to convert it to an external path here (plus this will only work for the default value, not for the variable value).
I'm on crack. Are you, too?
Comment #4
Dave ReidYes, I know, but this is only for display purposes. For instance if the user has set an alias for the node path as 'frontpage' they'll see 'frontpage' here. I'm pretty sure this is how we handle menu link paths as well in the interface. If not, we can toss it out.
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commented@Dave: your code only apply to the default value of the variable. The value of the variable itself is automatically loaded by system_settings_form().
Comment #6
Dave ReidDamn. Wish we could exclude an individual elements from the automatic default loading.
Comment #7
sunsubscribing
Comment #8
sunWhat's left?
Comment #9
sunThere are times when we simply can't rely on magic.
If this helper functionality doesn't support it, then we need to go back to old approaches.
Comment #10
Dave ReidIt's really too bad we can't exclude individual elements from the automatic default code.
Comment #11
catchThis removes one query from nearly all pages in HEAD. Although we cache system paths and try to load all at once, we don't do this well for drupal_get_normal_path(), and we don't cache paths without aliases (which /node or a view or panel used for the front page almost always lacks).
HEAD:
Executed 70 queries in 42.97 milliseconds.
Patch:
Executed 69 queries in 41.7 milliseconds.
+ // Get the normal path of the font page.
However
font page.
Otherwise RTBC.
Comment #12
catchDidn't mean to unassign.
Comment #13
sunRTBC as per catch.
Comment #14
catchLovely.
Comment #15
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #16
Dries CreditAttribution: Dries commentedComment #17
yched CreditAttribution: yched commentedsystem_update_N() needed a bump after http://drupal.org/cvs?commit=296276
Comment #18
cweagansPlease fix head. It's sorta important =P
Comment #19
ksenzeeYes please.
Comment #20
webchickOopsie. ;)
Committed.
Comment #21
webchickComment #23
Dave ReidThis should be backported to D6.
Comment #24
sunComment #25
rdrh555 CreditAttribution: rdrh555 commentedSome things seemed to have changed in the past 8 months and others seem to have worked their way into code naturally(specifically default_value => variable_get(*) ). I've attempted a patch.
Comment #26
dpearcefl CreditAttribution: dpearcefl commentedHas this issue been fixed in the latest D6?
Comment #27
sun@dpearceMN: Thanks for trying to triage the queue, but please don't mark such issues as needing more info. Obviously, it wasn't committed to D6 yet. This patch needs review and more work.