rejetto forum

Author Topic: 2.3d (292) : hfs.tpl :Delete after Archive repeats the archive download : FIXED  (Read 10797 times)

Offline skb

  • Occasional poster
  • *
  • Posts: 50
    • View Profile
Thank you for your help. You're right, it would be much easier to just use the Live template! But, it is too complex for my simple application.

Reading through the forum, I found a post where Rejetto recommended the tool Fiddler http://www.telerik.com/download/fiddler to capture the actual POST requests from the browser to HFS. (Fiddler is really cool!)

With a clean stock hfs.tpl, I tried a delete, then an archive, and then then another delete, which shows the bug: The archive command adds ?mode=archive to the URL in the POST, and this doesn't get cleared out by the delete command. Delete adds "&action=delete" to the end of the selection list, but this is overridden by the ?mode.

Here are the key lines of the raw POSTs from fidder. First, the initial Delete, which works properly:
Quote
POST http://localhost/BUS/ HTTP/1.1
   ...skipped...
selection=BUS_A60-Fishstick7&action=delete

Next, an Archive of two files, which also works:
Quote
POST http://localhost/BUS/?mode=archive&recursive HTTP/1.1
   ...skipped...
selection=BUS_A20-Shift_Hudson.txt&selection=BUS_A25-SF

Now try Delete on those same two files. This fails, and does another archive, because the "mode" string is still there:
Quote
POST http://localhost/BUS/?mode=archive&recursive HTTP/1.1
   ...skipped...
selection=BUS_A20-Shift_Hudson.txt&selection=BUS_A25-SF&action=delete

SO, the call to archive sets the mode, but the call to delete doesn't clear it.

Here's the post code for the Archive button (hfs.tpl line 201):
Code: [Select]
        <button id='archiveBtn' onclick='if (confirm("{.!confirm.}")) submit({}, "{.get|url|mode=archive|recursive.}")'>{.!Archive.}</button>
And the original code for the Delete button (hfs.tpl line 187):
Code: [Select]
        <button id='deleteBtn' onclick='if (confirm("{.!confirm.}")) submit({action:"delete"})'>{.!Delete.}</button>
The fix :) is to explicitly pass a URL with no mode string (REVISED hfs.tpl line 187): 
Code: [Select]
        <button id='deleteBtn' onclick='if (confirm("{.!confirm.}")) submit({action:"delete"}, "{.get|url.}")'>{.!Delete.}</button>

Follow members gave a thank to your post:


Thank-o-Matic 3.0 By Adk Team