On Mon, 7 Apr 2014, Jeremy Ruston wrote:

This is because it is trying to save to a bag that does not exist: "default".
The tiddler appears to be assigned this bag when it is dropped (or maybe it
gets it from the origin?)

Ah, yes, sounds like the plugin is coming in with a "bag" field, and TW5 is
blindly accepting it. I guess we should remove the "bag" field on import so
that the same processing would occur as with a manually newly created
tiddler?

Yes, I just tried simply removing the contents of the bag field
rather than setting it to an appropriate bag and the right thing
happened. So I would guess killing that field on drag would be the
right way to go.

If a tiddler has the type "application/json" does TiddlyWeb serve the text
field directly as the JSON representation, rather than serialising the
tiddler as normal? That's a bit unexpected if so. Is there a way I can
retrieve the ordinary serialized JSON representation?

The results that are happening is because of two things:

The tiddler is being PUT with content-type: application/json

   AND

The JSON object has a type field set to 'application/json'.

The upshot of this is that the tiddler is being accepted as a
pseudo-binary tiddler. When you GET the tiddler with either a
default Accept header OR with an Accept header that matches its
type you will get it in its raw form (the contents of the text
field) with a sent content-type field of the stored 'type' field.

This has a side effect of making text/plain, text/html and
application/json have "special" meaning when accessing a tiddler.

To get the tiddler back as a tiddler in JSON form it needs to put
with a 'type' field that is not application/json.

--
Chris Dent                                   http://burningchrome.com/
                                [...]

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to