TeamTasks

4 views
Skip to first unread message

Len

unread,
Nov 5, 2008, 11:20:59 PM11/5/08
to TiddlyWiki
I'm using teamtasks - it's perfect except about 60% of the time a new
task comes up with fields from the last task in the control instead of
"undefined". When I edit the fields both the new task and the old
task (that the settings came from) change to the new setting. For
example a new task for Bob comes up assigned to Frank. When I assign
it Bob, both the new task and the origianl Frank task become Bob's.
Arrggg.

Perhaps on a related note, a table with TTReportView calls (which
makes a great team dashboard) seems to periodically fill itself with
itself - where each cell of the table holds a new copy of the complete
table. Almost like perverted recursion.

I can't seem to find the pattern. Perhaps I'm not saving/clearing/
closing correctly but I've tried every sequence I could think of.
It's spoiling an otherwise perfect tool.

XP / Vista. Firefox. TeamTasks 0.4.1

Any thoughts?

Regards,
Len.

Eric Shulman

unread,
Nov 6, 2008, 3:44:57 AM11/6/08
to TiddlyWiki
> I'm using teamtasks - it's perfect except about 60% of the time a new
> task comes up with fields from the last task in the control instead of
> "undefined".  When I edit the fields both the new task and the old
> task (that the settings came from) change to the new setting.  For
> example a new task for Bob comes up assigned to Frank.  When I assign
> it Bob, both the new task and the origianl Frank task become Bob's.
> Arrggg.

I've seen a bug like this before (in other TW plugins)... which can be
caused by the following typical javascript coding sequence:
------------------
var frank=store.getTiddler("FranksTiddler");
var bob=new Tiddler();
bob.title="BobsTiddler";
... etc
bob.fields=frank.fields;
...
store.saveTiddler(bob.title,...,bob.fields);
------------------

The problem arises from this line:
bob.fields=frank.fields;
...while the intent is to copy the *value* of "frank.fields" into
"bob.fields", the effect is to copy a *reference* to "frank.fields"
into "bob.fields". Thus, both tiddlers will share the same "fields"
data, and any subsequent changes to fields in either tiddler will
appear to be applied to both tiddlers simultaneously.

The correct way to copy the internal values from one *object* to
another is to use the TW core's merge() function, like this:
merge(bob.fields,frank.fields);
which results in two *separate* copies of the field values, so that
changing a value in one tiddler will no longer change it in both
tiddlers.

Of course, the above is just a *possible* cause of the symptoms you
are observing... but perhaps it will help the TeamTasks folks find the
actual error in the code.

HTH,
-e
Eric Shulman
TiddlyTools / ELS Design Studios


PhilHawksworth

unread,
Nov 6, 2008, 4:42:27 AM11/6/08
to TiddlyWiki
Len,

Sorry to hear that TeamTasks is misbehaving, but happy you took the
time and effort to report the bug. Thanks!
I'll take a look at it and try to get a bugfix out quickly.

Thanks too to Eric for the pointer to where the problem is likely to
be. That will certainly speed things along.

I'll post here when a fix is available and also send a message via
http://twitter.com/teamtasks

Cheers,
Phil
Reply all
Reply to author
Forward
0 new messages