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.
I have the following in a theme function:
dpm(request_path());
dpm(current_path());
File paths are the only places where I'm not getting the expected result (path alias & un-aliased path), instead I just get nothing. Tested in Bartik & Omega 4.
Am I missing something here?
Comments
Comment #1
dddbbb CreditAttribution: dddbbb commentedUpdate: This works fine if the code is placed in a custom module. The issue only seems to arise if it's attempted at the theme level.
Comment #2
dddbbb CreditAttribution: dddbbb commentedUpdated issue title
Comment #3
Dave ReidI cannot duplicate this with a fresh install of core + File entity. My results for a file aliased as 'file/ceilingcatnotextgif' returned the following results using the two dpm() calls above:
file/ceilingcatnotextgif
file/1
Worth asking, you know you won't see the dpm() messages in any tpl.php files until the *next* page load right? So you have to reload the page to see what the previous page output. Sometimes that gets me off track so just wanted to check that's not the case.
Comment #4
dddbbb CreditAttribution: dddbbb commentedThanks Dave, I'll take another look with that in mind.
Comment #5
dddbbb CreditAttribution: dddbbb commentedSorry Dave, I've just tried this again since your response and all seems to be working fine. Not sure what caused the initial problem but it seems to have been fixed in the time that's passed.