It's not apparent to me that the Akamai module knows how to clear the home page URL. For instance, let's say I've created a home page panel with the path "home", and assigned it as the site's home page (site_frontpage). If I click the "Refresh Akamai cache" button from the home page, I see that the module will flush the path "home", i.e.,
When I really want it to flush
There should be logic in _akamai_get_all_paths to determine whether the submitted path matches site_frontpage. I haven't submitted a fix for this because I'm not sure how to translate this result back to akamai_clear_url. Should one of the returned paths be "", using Drupal shorthand, that then gets translated into the absolute URL of the home page?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | akamai-homepage-clear-d6-993738.patch | 2.58 KB | mdorman |
| #7 | akamai-homepage-clear-993738-7.patch | 3.69 KB | febbraro |
| #5 | akamai-homepage-clear-993738-5.patch | 3.69 KB | febbraro |
| #4 | akamai-homepage-clear-993738-4.patch | 2.8 KB | febbraro |
| #2 | patch.patch | 1.1 KB | hexblot |
Comments
Comment #1
mshmsh5000 commentedSorry, that last sentence should read, ...returned paths should be "<front>", using Drupal shorthand....
Comment #2
hexblot commentedI'm about to deploy this module, and noticed the above bug as well.
Indeed all you need is to pass a blank path to the function, which will then send only the base path (as declared in Akamai module administrative interface); e.g. http://www.example.com/
I've made a couple of changes there (see attached patch file):
* bit of a logic change, so that you only assign path once ( currently it assigns the default case and the alters it )
* get homepage path from variables
* if that's the current path, clear the path variable
* use a label instead of the path to be displayed on the block ( show '[frontpage]' instead of '' when clearing home)
Nothing big, but seems to work just fine so far.
Comment #3
febbraro commented@hexblot, thanks for the patch.
So if I understand this correctly then, if it is the front page it will now clear '' (blank) but no longer clear 'home' if 'home' is set in the site_frontpage variable?
Seems like if it is the frontpage we would need to support clearing both '' and 'home' (on submission get_all_paths will add in any additional aliases)
Comment #4
febbraro commentedOk, I took another crack at this. Also, this is present in the D7 version so I'm fixing it there first and can backport it.
This fixes:
* The label on the block if it's on the page that represents the homepage.
* Keeps the path in the form
* When it gets path aliases it will also add '' if it represents the homepage
* Adds a simpletest for all of the above.
Let me know if this works, I'll likely commit it in the next day or so, but let me know if you have any feedback.
Comment #5
febbraro commentedHere is another patch. I did a little bit of code cleanup and fixed a few php notices.
Going to commit this to the D7 branch.
Comment #6
febbraro commentedcommitted, now needs a backport to D6
Comment #7
febbraro commentedStupid typo in the patch. Grrr.
Comment #8
mshmsh5000 commentedIs this still in need of backporting to D6? Happy to take a crack at it if I'm not duplicating effort.
Comment #9
febbraro commentedHey @mshmsh5000 this stil does need a backport. If you want to take a shot I'd be more than happy to review and commit. Thanks! :)
Comment #10
mdorman commentedThis is a patch against the 6.x-1.2 version.
I'll test this a bit more tonight, but here's a backport D6 patch. When looking through the D7 work, I noticed one extra case missing. If a user enters an aliased path of the node/panel/view/etc in the site info page the site_frontpage variable gets stored as the alias, therefore the current logic in the D7 doesn't pick that match up.
Comment #11
febbraro commentedComment #16
bighappyface commentedComment #17
bighappyface commented