'edit with form'-Tab

3 views
Skip to first unread message

Mitchel Berberich

unread,
Jun 8, 2007, 2:08:43 AM6/8/07
to Semantic Forms
Hi.

one minor problem i have just recognized: having a wiki in which users
must be logged in before editing pages ...

if you click on the normal "edit" tab you get an message that you must
be logged in to edit this page containing a link to the login page. No
input fields are being displayed.

if you click on "edit with form" you get the normal form page, you
enter all data and after klicking "save" you are being told that your
data cannot be saved. That can be quite frustrating for first time
users.

- Mitchel

Yaron Koren

unread,
Jun 8, 2007, 8:38:42 AM6/8/07
to Semantic Forms
Hi Mitchel,

That's strange that this is happening for you. There's a check in the
code (/includes/SF_FormEditTab.php, line 37) that displays the tab
only if the user is allowed to edit this page (the "userCanEdit()"
method). Does your version of the code have this check? If so, that
MediaWiki method must be returning the wrong value; very puzzling.

-Yaron

Mitchel Berberich

unread,
Jun 8, 2007, 2:21:13 PM6/8/07
to Semantic Forms
Hi.

Sorry, seams I mixed two things up this morning...

The first kind of protection for wiki pages is that you can make one
page a protected one. userCanEdit (the check is in line 37 of my
version, too) reflects this and indeed hides the tab on protected
pages.

But there is also a second kind of protection which can be enabled in
LocalSettings.php:

$wgGroupPermissions['*']['edit'] = false; # user must login to edit.

That setting is ignored by the userCanEdit-Function and so the "Edit
with Form"-tab is shown even though the user will not be able to save
his input.

As I now found out having a closer look on the issue, the normal
'Edit' tab is also shown in this case ...

But the problem exists independend of the question if the tab is
shown: There always can be an other way to get to the Form-page-URL
(for example when the template contains a link to the special page
"please follow this link to edit the data shown on this page". And
then you get the form, enter a lot of data and are beeing told
afterwards that you cannot save it.

How does the normal Edit-page handle this problem? When trying to open
a normal Edit-page-URL in media wiki it is checked before that the
user has the right to save the data. The Editor is only shown if the
user has all rights needed. Otherwise the user is being redirected to
the login page. I think i found the code for testing this is in
includes/EditPage.php lines 308++

if ( !$wgUser->isAllowed('edit') ) {
if ( $wgUser->isAnon() ) {
wfDebug( "$fname: user must log in\n" );
$this->userNotLoggedInPage();
wfProfileOut( $fname );
return;
} else {
wfDebug( "$fname: read-only page\n" );
$wgOut->readOnlyPage( $this->getContent(), true );
wfProfileOut( $fname );
return;
}
}

- Mitchel

> > - Mitchel- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Yaron Koren

unread,
Jun 8, 2007, 2:34:51 PM6/8/07
to Semantic Forms
Yeah, I see the issue. The page itself should do the checking, not
just the tab. And there should probably be a similar check for the
"add data" page, and maybe the "create template" and "create form"
pages too.

Also, maybe the "edit with form" tab shouldn't have a check, but
should always appear, just like the "edit" tab - that way readers can
know that the functionality exists, even if they can't get to it
themselves.

-Yaron

Sergey Chernyshev

unread,
Jun 8, 2007, 4:43:57 PM6/8/07
to semanti...@googlegroups.com
It can even show disabled form, for example - this might be a cool way to advertise this functionality ;)

Yaron Koren

unread,
Jun 8, 2007, 5:09:51 PM6/8/07
to Semantic Forms
That's not altogether a bad idea - might as well show a user as much
as possible, without making them waste their time filling out
fields...

-Yaron


On Jun 8, 4:43 pm, "Sergey Chernyshev" <sergey.chernys...@gmail.com>
wrote:


> It can even show disabled form, for example - this might be a cool way to
> advertise this functionality ;)
>

Yaron Koren

unread,
Jun 10, 2007, 10:25:05 PM6/10/07
to Semantic Forms
Okay, the new version of Semantic Forms is out, version 0.2.5. The
"edit with form" tab now always shows up again, and the edit form
itself is disabled if the user isn't allowed to edit the page. That
way everyone can see the functionality, even if they can't use it
themselves. If you download it, let me know what you think.

-Yaron

Reply all
Reply to author
Forward
0 new messages