<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Dreamwidth Development Training</title>
  <link>https://dw-dev-training.dreamwidth.org/</link>
  <description>Dreamwidth Development Training - Dreamwidth Studios</description>
  <lastBuildDate>Sun, 23 Jun 2013 13:38:12 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>dw_dev_training</lj:journal>
  <lj:journaltype>community</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/92798/30813</url>
    <title>Dreamwidth Development Training</title>
    <link>https://dw-dev-training.dreamwidth.org/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>https://dw-dev-training.dreamwidth.org/50471.html</guid>
  <pubDate>Sun, 23 Jun 2013 13:38:12 GMT</pubDate>
  <title>Workflow for BML conversion</title>
  <link>https://dw-dev-training.dreamwidth.org/50471.html</link>
  <description>Posted by: &lt;span lj:user=&apos;kaberett&apos; style=&apos;white-space: nowrap;&apos; class=&apos;ljuser&apos;&gt;&lt;a href=&apos;https://kaberett.dreamwidth.org/profile&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[personal profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://kaberett.dreamwidth.org/&apos;&gt;&lt;b&gt;kaberett&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&apos;white-space: nowrap;&apos;&gt;&lt;a href=&apos;https://foxfirefey.dreamwidth.org/profile&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[personal profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://foxfirefey.dreamwidth.org/&apos;&gt;&lt;b&gt;foxfirefey&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; has, at my request, very kindly put together &lt;a href=&quot;http://wiki.dwscoalition.org/wiki/index.php/Routing_and_Template_Cookbook:_BML_Conversion_Workflow&quot;&gt;a skeleton sample workflow for converting pages from BML to more sensible languages&lt;/a&gt; (apparently we&apos;re at about 45k lines of code to go!). Alas they did not as per my request call it &quot;How to kill BML with fire&quot; ;)&lt;br /&gt;&lt;br /&gt;If you, too, have been contemplating getting into this, there is now a bit of a guide!&lt;br /&gt;&lt;br /&gt;If you have done it and you Know Stuff that ought to be in the docs, please add it!&lt;br /&gt;&lt;br /&gt;Thank you lots. &amp;hearts;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=dw_dev_training&amp;ditemid=50471&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://dw-dev-training.dreamwidth.org/50471.html</comments>
  <category>tt</category>
  <category>wiki</category>
  <category>bml</category>
  <lj:security>public</lj:security>
  <lj:poster>kaberett</lj:poster>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>https://dw-dev-training.dreamwidth.org/38059.html</guid>
  <pubDate>Fri, 17 Aug 2012 09:10:50 GMT</pubDate>
  <title>More CAPTCHA-related fun (bug 4513)</title>
  <link>https://dw-dev-training.dreamwidth.org/38059.html</link>
  <description>Posted by: &lt;span lj:user=&apos;swaldman&apos; style=&apos;white-space: nowrap;&apos; class=&apos;ljuser&apos;&gt;&lt;a href=&apos;https://swaldman.dreamwidth.org/profile&apos;&gt;&lt;img src=&apos;https://www.dreamwidth.org/img/silk/identity/user.png&apos; alt=&apos;[personal profile] &apos; width=&apos;17&apos; height=&apos;17&apos; style=&apos;vertical-align: text-bottom; border: 0; padding-right: 1px;&apos; /&gt;&lt;/a&gt;&lt;a href=&apos;https://swaldman.dreamwidth.org/&apos;&gt;&lt;b&gt;swaldman&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As some know, I&apos;ve been working on the remaining bit of bug 4513 - that text CAPTCHAs always fail when non-logged-in OpenID&amp;nbsp;users try to comment on a post. It&apos;s taken me somewhat further down the rabbit-hole than I&amp;nbsp;expected ;-)&amp;nbsp;I&amp;nbsp;wanted to discuss two possible routes to fixing it - not sure whether such discussion is better here or on bugzilla?&lt;br /&gt;&lt;br /&gt;So, background follows (and thanks to people on IRC&amp;nbsp;last night, especially Dre, for helping me figure much of this out).&lt;ul&gt;&lt;li&gt;When a form includes a captcha, and that captcha needs verifying to see whether the right answer is given, the code that is evaluating that form uses various functions in DW::Captcha, passing the form (as a hashref, I think?)&amp;nbsp;in the parameters.&lt;/li&gt;&lt;li&gt;The TextCAPTCHA&amp;nbsp;handler ignores the form that it is passed, and simply looks up the form submission in the&amp;nbsp; http request instead.&lt;/li&gt;&lt;li&gt;This works fine except for one case - where a non-logged-in OpenID user is submitting a comment. In this case, because of the way that OpenID works, the http request that led to this code being run doesn&apos;t have the form in, so the correct answer to the captcha (included in the form, hashed in a hidden field)&amp;nbsp;and the given answer are lost.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Initially&amp;nbsp;I thought to fix this by getting the textcaptcha handler to look at the form it is given rather than doing its own thing. When&amp;nbsp;I did this, the OpenID special case started working but everything &lt;em&gt;else&lt;/em&gt; broke, some of the time ;-) After a lot of &amp;quot;WTF&amp;quot; I realised why Fu had originally written the textcaptcha handler the way she had: &lt;br /&gt;&lt;br /&gt;Textcaptchas can have more than one correct answer (e.g. &amp;quot;7&amp;quot; and &amp;quot;seven&amp;quot;). When a form containing a captcha with two correct answers is received by a BML&amp;nbsp;page and translated into the %POST&amp;nbsp;variable, the hashes of the two correct answers are concatenated together, separated by a null character[1]. Apparently when the form is received by a TT&amp;nbsp;page, something different will happen. Grabbing the form directly from the http request means that things will be in a consistent format regardless of BML/TT/whatever, so doing it that way avoided complexity. Except that it doesn&apos;t work with OpenID ;-)&lt;br /&gt;&lt;br /&gt;So, as I&amp;nbsp;see it there are two possible ways to fix:&lt;ol&gt;&lt;li&gt;Get the textcaptcha handler to always pay attention to the form that it is passed, but to also check whether it is being passed a form by a BML&amp;nbsp;page or by a TT&amp;nbsp;page, and process the captcha&apos;s correct answers differently accordingly.&lt;/li&gt;&lt;li&gt;Have the textcaptcha check whether it is being used in a comment submission (which could use OpenID)&amp;nbsp;or not. If it is, have it use the form that it is passed and account for what BML&amp;nbsp;does to the field; if it is not, behave as it does at present and grab the form from the http request.&lt;/li&gt;&lt;/ol&gt;In other words, we either treat all BML pages differently to all TT pages, or we treat all comment forms (whether or not they use OpenID) differently to all other forms.&lt;br /&gt;&lt;br /&gt;Option 1 intuitively seems more elegant to me, simply because once we no longer support BML&amp;nbsp;we can remove the relevant code from one place (the textcaptcha handler)&amp;nbsp;and be left with consistent handling of all captchas site-wide.&lt;br /&gt;&lt;br /&gt;Option 2 was generally favoured on IRC&amp;nbsp;last night, and as I&amp;nbsp;said there I&apos;m quite happy to accept this advice from those with vastly more expertise and knowledge, so long as I understand the reason :-) However, note that with this approach comment forms will always remain a special case - even after BML&amp;nbsp;is done away with - because of the need to allow for OpenID redirects.&lt;br /&gt;&lt;br /&gt;Either way, I&amp;nbsp;need advice:&lt;br /&gt;If implementing Option 1, how does TT&amp;nbsp;behave when it encounters a form with two fields of the same name? I&amp;nbsp;would need to figure out how to tell the difference in what the textcaptcha handler receives so as to treat it accordingly. Are there any TT-based forms that use captchas as yet, to allow for testing?&lt;br /&gt;&lt;br /&gt;If implementing Option 2, how can the textcaptcha handler know what page it is being called from? There is already a $page parameter that is used in most places (for instance, when a captcha is included on the lostinfo page, $page=&amp;quot;lostinfo&amp;quot; is passed). However, when a captcha is included on the commenting form, $page=undef. I&amp;nbsp;don&apos;t know whether I&amp;nbsp;can just change this to something informative, or whether there is a reason for keeping it undef (possibly because in this instance the captcha is dealt with by a .pm file rather than directly in the BML)&lt;br /&gt;So... comments, advice, and &amp;quot;WTF are you talking about, this doesn&apos;t make sense&amp;quot;, all welcome. Thanks in advance :-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS:&amp;nbsp;I&amp;nbsp;realise that this is a tiny edge-case that I&apos;m trying to fix, and that experienced people would probably have Just Fixed It. But,&amp;nbsp;I want to get it right ;-)&lt;br /&gt;&lt;br /&gt;EDIT:&amp;nbsp;Just realised that the above is probably made even less comprehensible by the fact that I&apos;m using &amp;quot;hash&amp;quot; in the md5 sense rather than the perl sense, most of the time. Words, they mean multiple different things. How inconvenient ;-)&lt;br /&gt;&lt;br /&gt;[1] No,&amp;nbsp;I&amp;nbsp;didn&apos;t know what a null character was until yesterday...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=dw_dev_training&amp;ditemid=38059&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://dw-dev-training.dreamwidth.org/38059.html</comments>
  <category>forms</category>
  <category>captcha</category>
  <category>bml</category>
  <lj:mood>deeper in code than expected</lj:mood>
  <lj:security>public</lj:security>
  <lj:poster>swaldman</lj:poster>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
