Last modified: 2011-03-13 18:06:11 UTC
If user can't edit the page, there is no point to show "Edit with form" tab so let's disable it.
I'm puzzled - is that from the same guy who wrote this? :)
Created attachment 4135 [details]
Disables "Edit with form" tab if user don't have permissions to edit the page
This patch is made against 0.5.7 but it seems to be the issue in latest release as well.
(In reply to comment #1)
> I'm puzzled - is that from the same guy who wrote this? :)
Looks like the same guy ;)
The problem is that even being logged in, user is not necessarily allowed to edit the page (e.g. if user is restricted to only edit their own page or if page is simply protected by admin) - in this case there is no real point for showing the tab and disabled form.
Do you think it makes sense to separate "Logged out" case from "Not allowed" case?
Well, right now the "edit" tab always appears, even if you can't edit; though it often shows up as "view source" when you can't edit the page. I like the fact that you can always at least see which pages are form-editable, and what the form looks like. What about just renaming the tab to, say, "view form", if you lack the permission to edit for any reason?
Yeh, renaming it is good, but also, I'd make it optionally removable based on configuration parameter.
Strange, but my patch is having trouble with some pages
$target_title = Title::newFromText($target_name);
(In reply to comment #6)
> Strange, but my patch is having trouble with some pages
> $target_title = Title::newFromText($target_name);
> returns nothing.
It returns either a Title object, or null. In the latter case, $target_name is an invalid title. You can check for this with is_null($target_title)
Thank you, I'll try to debug - it did freak out on a subpage with parenthesis so maybe there is some sort of title escaping needs to be done.
I'm changing this to "WONTFIX": the tab now shows up as "view form" if the user can't edit the page - I don't see a need to ever hide the tab completely.
By default it makes sense to have it like this, but it should be possible to remove tab completely with some configuration parameter - many people build sites where "edit" appears only when it's allowed.
Dispute resolved, after some private discussion - apparently there's no automatic way to hide the "edit" tab either. Setting back to "won't fix".