Whan that Aprill with his showres soote
The droghte of March hath perced to the roote,
And bathed every veyne in swich licour
Of which vertu engendred is the flour

…Thanne longen folk to staren less at screenes
And thereto swynken mun in sondry londes
And wenden for to seken straunge strondes
Wherefore have I ywroght but littel code
Of whyche I now shall speke, eek in this node:

As in the past month or three, my contributions fall under the two general headings of 'drafts' and 'other stuff,' whereby the 'other stuff' was unrelated to the Great Leap Forward in hosting recounted above by OldMiner. While he and others were building a new house and putting in the wiring, I was screwing together a new bedside table, moving the furniture around, and repainting the carpet:

Drafts

This month's innovation was being able to attach a draft to a page (or 'node' as we call it in these parts). Drafts created from an everything2 page are by default attached to it, those created from the drafts page can be attached if you want. You can change which page a draft is attached to or detach it so it isn't attached to anything. The mechanism by which drafts are attached to a node (by a link of type 'parent_node') is separate from that for writeups, avoiding a lot of potential complications. The few changes required were:

  1. setdraftstatus offers an option to attach/detach.
  2. zen e2node display page shows attached drafts as appropriate. The author always sees them, others are informed of the presence of any they are allowed to see, and can click a link to see them if they want to.
  3. canseewriteup notes a user's own contribution to a page, whether published writeup or attached draft, and addwriteup provides a form to edit it on the page.
  4. draft display page remembers which page a deleted draft was attached to so it can be reattached it if the user undoes the deletion.
  5. publishdraft removes any attachment links from a draft before publishing it.
  6. repair e2node removes any inexplicable remaining draft-attachment links to published writeups.

In addition to which:

  1. When a draft with a duplicate-buster number tacked on at the end is being published or attached, the number is initially removed from the suggested title. If the user really wants a page with a number in its title, they can put it back (parentdraft).
  2. If a user's writeup is renamed to a title that matches one of their drafts, a duplicate-buster number is added to the title of the draft (writeup maintenance update).
  3. The code in publishdraft for creating a new page to which to publish a draft as a writeup uses the insertNode function instead of opNew, and sets the query parameter 'writeup_parent_e2node' to the id of the new node so that it will end up properly parented if something goes wrong. (Unless something else goes wrong, of course.)

Other stuff

  1. e2node edit page: when the title of an e2node is changed, the writeups in the node are not reordered.
  2. If you are looking at someone else's drafts, and they have some but you can't see any of them, the Drafts page does the right thing. As opposed to a wrong thing. Which it did before. Who needs an empty list?
  3. If display draft is passed a writeup instead of a draft, it will still display it. This can be the Right Thing to happen, given the fact that the writeup nodetype inherits from nodetype draft. (See 'Drafts and Writeups: a tale of Two Nodetypes', in root log: February 2011.)
  4. A change I had made to Everything2 Ajax to allow empty parameters to be sent by AJAX led to writeups being nuked immediately instead of being put on Node Row. This was because the opcode massacre was only checking to see if the appropriate 'instakill' parameter existed, and didn't care if it had a value or not. So it now checks to make sure that the parameter has a value, and the killing floor II gives it a value for those times when you don't want to kill with AJAX. And so that nothing else like this can happen, Everything2 Ajax no longer sends empty values for checkboxes and radio buttons.
  5. Internet Explorer 7 was wrapping the number of C!s given to writeups over two lines in Everything User Search, leading to great fuggliness. Giving the table-cell in which the C!s are shown a completely superfluous width definition sorted that one out.
  6. There had at some point been a check in e2node maintenance delete to avoid an infinite loop when deleting a broken e2node that was included in its own node group. This check was cheesy and didn't always work, and had therefore been disabled. It is now not cheesy, it works, and it is active.