Page MenuHomePhabricator

allow LinksUpdate with API
Closed, ResolvedPublic

Description

For update all links from a page with the api it is necessary to get the full revision and put it as edit back (nulledit).

But this is not possible for all users for full protected pages.

Is there a way, not using the restricted action=edit for update all links of a page?

Maybe add a linksupdate param to action=purge.

Thanks.


Version: 1.18.x
Severity: enhancement

Details

Reference
bz26498

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:20 PM
bzimport set Reference to bz26498.

What's the difference between the null edit and the purge...?

Nulledit also refreshed the database table like templatelinks, imagelinks, pagelinks and categorylinks and not only the html version of the page.

Hmm.

It's doable through the interface, so the API could allow it. It's just about doing mass null edits that we might have issues...

(In reply to comment #3)

Hmm.

It's doable through the interface, so the API could allow it. It's just about
doing mass null edits that we might have issues...

As long as null edits would count towards the rate limit, this shouldn't create any new problems, right?

Indeed

Marking it as action=purge&nulledit maybe

As nulledit makes more sense in the wiki community, than "linkupdate"

(In reply to comment #5)

Indeed
Marking it as action=purge&nulledit maybe
As nulledit makes more sense in the wiki community, than "linkupdate"

linkupdate is technical, that is right, but in my opinion the best description. But feel free to name it, like you find the best.

linkupdate may or may not be right depending on what will happen when one uses it ;-)

if this new parameter will make a nulledit there is most likely more happening then just 'linkupdate'.

Created attachment 7951
add param forcelinkupdate to action=purge

Using LinksUpdate is not a nulledit.

The attachment used LinksUpdate, but it does not aware of ratelimit.

Feel free to modify.

Attached:

I'm just wondering about resaving it to the cache. Seemingly, the parseroutput, and the article, aren't actually changed...

I haven't actually looked how it's used elsewhere yet (I'm waiting for some things to run so I can find out)

Will have a look later, unless you can enlighten me beforehand...

(In reply to comment #9)

I'm just wondering about resaving it to the cache. Seemingly, the parseroutput,
and the article, aren't actually changed...

ParserOutput contains the link arrays as well, so it quite possibly does change.

$this->mLinks = $parserOutput->getLinks();

The definitions in ParserOutput

00144 function &getLinks() { return $this->mLinks; }

So it must do...

In EditPage

		if ( $wgUser->pingLimiter() ) {
			wfProfileOut( __METHOD__ . '-checks' );
			wfProfileOut( __METHOD__ );
			return self::AS_RATE_LIMITED;
		}

Is it just doing the pingLimiter check whilst doing the linkupdate? Will the link update actually affect any of the counters that are doing this, or is adding it not going to be of much use...?

r79638

Tweaked patch applied, thanks for supplying it.

Just a TODO/note on the commit, how do we want to deal with errors from the ping limiter