Sat 30 Jun 2007 10:03:11 PM UTC, original submission:
PROBLEM:
Someone publishes an article with format e.g. textile or html, using the advanced interface to select the format, and sets open editing = true.
Someone else with a login and using the basic interface tries editing the article. S/he previews and sees that the article is not rendered as (textile or html). If s/he confirms, then the article is updated with format = nil.
LIKELY EFFECT:
The user probably will notice the problem. S/he might: become discouraged and say that samizdat is too complicated; edit away all the textile/html markings :P since "clearly" they shouldn't be there. Almost certainly this will create confusion and frustration. The user will not necessarily think of clicking on "settings", "advanced settings" and returning to the editing window.
PROPOSED FIX:
i think the problem is only with the format parameter; e.g. lang doesn't have this problem. There might be a neater way of solving this, but my suggestion is to post a hidden field with the old format value, whatever that may be.
It seems to work for me.
This is against 070618, but the bug was there for quite some time.
--- /tmp/tmp_snapshot/samizdat/lib/samizdat/controllers/message_controller.rb 2007-06-18 13:01:02.000000000 +0200
+++ /usr/lib/ruby/1.8/samizdat/controllers/message_controller.rb 2007-06-30 23:46:36.197804000 +0200
@@ -364,6 +402,8 @@
[:checkbox, 'open', @message.open,
(options.include?(:disable_open) ? :disabled : nil)]
)
+ else # keep old values even with basic interface
+ fields.push([:hidden, 'format', @old_content.format ])
end
fields.push([:br], [:submit, 'preview', _('Preview')])
|