Last modified: 2011-08-22 10:26:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31859, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29859 - [ApprovedRevs] Incorrect robot policy handling when using ApprovedRevs extension
[ApprovedRevs] Incorrect robot policy handling when using ApprovedRevs extension
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Other (Other open bugs)
unspecified
All Linux
: Low normal (vote)
: ---
Assigned To: Yaron Koren
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-13 07:55 UTC by Atte Peltomaki
Modified: 2011-08-22 10:26 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch (374 bytes, patch)
2011-07-13 07:55 UTC, Atte Peltomaki
Details

Description Atte Peltomaki 2011-07-13 07:55:27 UTC
Created attachment 8777 [details]
Patch

When using ApprovedRevs extension, all pages configured for the extension are always tagged with "noindex,nofollow". Trivial patch attached that fixes this.
Comment 1 Sam Reed (reedy) 2011-07-13 09:25:02 UTC
Comment on attachment 8777 [details]
Patch

>--- Article.php.orig	2011-07-13 10:02:31.727795843 +0300
>+++ Article.php	2011-07-13 10:02:21.657795857 +0300
>@@ -1127,7 +1127,7 @@
> 			}
> 		}
> 
>-		if ( $this->getID() === 0 || $this->getOldID() ) {
>+		if ( $this->getID() === 0 || $this->getOldID() != $this->mLatest) {
> 			# Non-articles (special pages etc), and old revisions
> 			return array(
> 				'index'  => 'noindex',
>
Comment 2 Mark A. Hershberger 2011-07-18 17:24:59 UTC
In order to make this small change easier to review, could you add a comment to the patch saying when getOldID would return a true value != mLatest?
Comment 3 Atte Peltomaki 2011-07-19 03:04:17 UTC
It already says that, right below the line:
"# Non-articles (special pages etc), and old revisions" 

This patch just slightly improves the logic, so that simply having mOldID does not automatically indicate that an old revision is being viewed.
Comment 4 Yaron Koren 2011-07-19 03:07:19 UTC
Assigning to myself, as the author of Approved Revs.
Comment 5 Toni Hermoso Pulido 2011-08-07 18:26:27 UTC
(In reply to comment #3)
> It already says that, right below the line:
> "# Non-articles (special pages etc), and old revisions" 
> 
> This patch just slightly improves the logic, so that simply having mOldID does
> not automatically indicate that an old revision is being viewed.

Yes, it does not solve the problem. As a workaround I put :

For any casual person who visited this bug, like me today, I changed in Article.php:

if ( $this->getID() === 0  ) {

}
and then I patched my skin to look at oldid and action in URL for adding noindex,nofollow.
Comment 6 Yaron Koren 2011-08-14 14:25:14 UTC
I just finally looked into this patch, and realized that it's a patch for core MediaWiki, not the Approved Revs extension - which explains why various people have been commenting on it. Perhaps this should be assigned to someone else, then? And renamed? (It was my mistake for assigning it to myself in the first place.)
Comment 7 Mark A. Hershberger 2011-08-16 16:14:04 UTC
(In reply to comment #5)
> For any casual person who visited this bug, like me today, I changed in
> Article.php:
> 
> if ( $this->getID() === 0  ) {
> 
> }
> and then I patched my skin to look at oldid and action in URL for adding
> noindex,nofollow.

Could you clarify this?  I'd like to apply this fix, but I don't quite understand your fix.
Comment 8 Toni Hermoso Pulido 2011-08-18 09:51:34 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > For any casual person who visited this bug, like me today, I changed in
> > Article.php:
> > 
> > if ( $this->getID() === 0  ) {
> > 
> > }
> > and then I patched my skin to look at oldid and action in URL for adding
> > noindex,nofollow.
> 
> Could you clarify this?  I'd like to apply this fix, but I don't quite
> understand your fix.

Hello Mark,

my fix is a workaround and not clean. I just added a parsing of $_SERVER['REQUEST_URI'] against 'action' and 'oldid' in my custom skin and I add meta tag then.

Let me see if I can find a cleaner way.
Comment 9 Atte Peltomaki 2011-08-22 07:52:58 UTC
I don't quite see what the problem is with my original patch.
Comment 10 Toni Hermoso Pulido 2011-08-22 07:56:13 UTC
(In reply to comment #9)
> I don't quite see what the problem is with my original patch.

If I don't remind badly when I tried myself, it adds noindex in those cases that the actual approved page is not the latest one.
Comment 11 Atte Peltomaki 2011-08-22 10:04:07 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > I don't quite see what the problem is with my original patch.
> 
> If I don't remind badly when I tried myself, it adds noindex in those cases
> that the actual approved page is not the latest one.

The patch doesn't do that; it just doesn't fix it, either. I'm not familiar enough with mediawiki code to come up with a clean fix for that.
Comment 12 Toni Hermoso Pulido 2011-08-22 10:26:20 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #9)
> > > I don't quite see what the problem is with my original patch.
> > 
> > If I don't remind badly when I tried myself, it adds noindex in those cases
> > that the actual approved page is not the latest one.
> 
> The patch doesn't do that; it just doesn't fix it, either. I'm not familiar
> enough with mediawiki code to come up with a clean fix for that.

I would dare to say that your patch works as far as the approved revision is the latest one.
I must say I'm not familiar enough either with MW guts. I will try to find some time to learn, though, if noone else can find a quickier solution.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links