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.,

http://example.com/home

When I really want it to flush

http://example.com/

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?

Comments

mshmsh5000’s picture

Sorry, that last sentence should read, ...returned paths should be "<front>", using Drupal shorthand....

hexblot’s picture

StatusFileSize
new1.1 KB

I'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.

febbraro’s picture

Assigned: Unassigned » febbraro

@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)

febbraro’s picture

Version: 6.x-1.2 » 7.x-1.0-beta1
StatusFileSize
new2.8 KB

Ok, 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.

febbraro’s picture

StatusFileSize
new3.69 KB

Here 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.

febbraro’s picture

Status: Active » Patch (to be ported)

committed, now needs a backport to D6

febbraro’s picture

StatusFileSize
new3.69 KB

Stupid typo in the patch. Grrr.

mshmsh5000’s picture

Is this still in need of backporting to D6? Happy to take a crack at it if I'm not duplicating effort.

febbraro’s picture

Hey @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! :)

mdorman’s picture

StatusFileSize
new2.58 KB

This 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.

febbraro’s picture

Version: 7.x-1.0-beta1 » 6.x-1.2

  • Commit 34472db on 7.x-1.x, 8.x-1.x by febbraro:
    #993738: fixing homepage clears by hexblot
    
    

  • Commit 34472db on 7.x-1.x, 8.x-1.x, 7.x-2.x by febbraro:
    #993738: fixing homepage clears by hexblot
    
    

  • Commit 34472db on 7.x-1.x, 8.x-1.x, 7.x-2.x, 8.x-2.x by febbraro:
    #993738: fixing homepage clears by hexblot
    
    

  • febbraro committed 34472db on 7.x-3.x
    #993738: fixing homepage clears by hexblot
    
    
bighappyface’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed
bighappyface’s picture

Status: Fixed » Closed (fixed)