mmm ... Why limit the scope of default and preload to the act of
*creating* a page?

If there is a good reason for limiting the scope then might I suggest
the "current user" keyword be changed to "page creator" to better
reflect the singular, historical nature of the username that will be
substituted. The choice of word "adding" is unfortunate because it is
easily interpreted to mean adding data to a pre-existing page as well
as the act of adding a new page.

However rather than limiting the scope, I encourage you to imagine the
possibilities if "current user" really does substitute a username that
reflects the user who is presently interacting with the semantic form
to edit an existing page. (For an unregistered user perhaps that
'username' is their IP address.)

- - - -

I am not sure what system you are referring to but my system (or setup
as you call it) uses the string property "Is a favorite of"

Of course, each username is a simple string. By repeatedly annotating
username strings with this one property a comma separated list of
usernames becomes associated with any given page.

Ideally a user can add or remove just their own username and not
another's name. (This is why it became important to me that "|
default=current user" be contemporary with whichever user is currently
interacting with the semantic form - regardless of whether they are
using a partial form, the default form or an alternate form.)

So within that setup the act of removing a username from the list of
usernames is a string replace operation. Adding a username is a simple
semantic annotation - even if it is found to be redundant.

I don't attempt to detect whether or not the username is already in
the list. It isn't important to the task at hand.

- - -

As an expedient workaround I have added the [[category:Users]] tag to
each User:Username page. (Wikia provides a welcome message bot that
will continue with that for newcomers.)

I then use an "|input type=dropdown" for the form and "|values from
category=Users" to effectively restrict string input to just the set
of registered usernames. The obvious down side to this workaround is
that it does allow one user to add another user's name to the "Is a
favorite of" delimited list.


On Jul 17, 10:33 pm, Yaron Koren <yaro...@gmail.com> wrote:
> Hi,
>
> Well, defaults and preloads only apply when you're adding a new page (or
> data), not editing an existing one - I don't quite understand how your setup
> works, but somehow the system needs to differentiate between a user who has
> already entered their "favorite" information and one who hasn't.
>
> -Yaron
>
> On Fri, Jul 17, 2009 at 2:56 AM, najevi <naj...@gmail.com> wrote:
>
> > == Bug report ==
> > {{field ... |default=current user ... }}
>
> > is not substituting the name of the user who is currently attempting
> > to edit the page using a form. Instead, it is returning the name of
> > whichever user initially *created* the current page.
>
> > I am certain that is a bug or at best bad description at the
> > documentation page:
> >http://www.mediawiki.org/wiki/Extension:Semantic_Forms#Form_markup_la...
> > Quote:
> > "
> > default=default value - Specifies a default value for this field. For
> > date-related fields, default=now will set the value to the current
> > date and possibly time. For text fields, default=current user will set
> > the value to the username of the user adding this page.
> > "
>
> > If "|default=now" returned the date-time-stamp of whenever the current
> > page was initially *created* than I am certain that a reasonable
> > person would consider that to be a bug.
> > By that same argument I will assume the present behavior for "|
> > default=current user" to also be a bug. ... until told differently!
>
> > Test cases:
> >http://smwtest.wikia.com/wiki/Special:EditData/Favorites/Skin31 -
> > created by user: Delica
> >http://smwtest.wikia.com/wiki/Special:EditData/Favorites/Skin27 -
> > created by user: Najevi
>
> > To assist debug, I have temporarily made the "This user" property
> > value visible in that partial form.
>
> > == Possibly helpful ==
> > IRC user padde reports that the code for this shows:
> > [16:34] <padde>  // if the field is a text field, and its default
> > value was set
> > [16:34] <padde> // to 'current user', and it has no current value, set
> > $cur_value
> > [16:34] <padde> // to be the current user
> > source: includes/SF_FormPrinter.inc
>
> > I am a user and not a developer so I don't plan to go investigating
> > such include files. As a practical matter I can do nothing about them
> > since I rely on Wikia for such "back end" assistance and they also
> > seem quite new to SMW/SF.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Semantic Forms" group.
To post to this group, send email to semantic-forms@googlegroups.com
To unsubscribe from this group, send email to 
semantic-forms+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/semantic-forms?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to