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
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
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 -
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
-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