Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2014 at 19:29 UTC
Updated:
11 Sep 2019 at 13:52 UTC
Jump to comment: Most recent
Comments
Comment #1
dergachev commentedComment #2
siliconmind commentedWell, this is rather obvious since $_GET['q'] for drush and cron is empty. It's like accessing your site via index.php directly. What you'd expect?
Comment #3
acrosmanI agree with evolvingweb: I'd expect it to return false since there is no "current page" during drush or cron. If you're using drupal_is_front_page() within a hook that gets called in one of those contexts Drupal is telling you the front page is being displayed and therefore the code may either waste time or do something wholly inappropriate. Clearly this isn't a huge issue for many people, but it still seems incorrect since it's not like accessing the site via index.php: it's like accessing your site via cron.php or an outside application.
Comment #4
dineshw commentedIt doesn't work either in hook_page_alter() for frontpages.
For me it works in local not on acquia.
Comment #5
dalinThe simple workaround would be: