Last modified: 2008-09-07 19:05:16 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 T17359, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15359 - getAllowedParams() and friends should have hooks
getAllowedParams() and friends should have hooks
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.14.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-28 20:40 UTC by Roan Kattouw
Modified: 2008-09-07 19:05 UTC (History)
3 users (show)

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


Attachments
Implement ApiParams Hook (2.74 KB, patch)
2008-08-28 21:53 UTC, Chad H.
Details
Improved patch (4.13 KB, patch)
2008-09-06 12:38 UTC, Roan Kattouw
Details

Description Roan Kattouw 2008-08-28 20:40:10 UTC
...so extensions can add parameters cleanly. One generic hook that passes a reference to the module is probably best.
Comment 1 Chad H. 2008-08-28 21:53:27 UTC
Created attachment 5225 [details]
Implement ApiParams Hook

Basic implementation of an ApiParams hook. All uses calling getAllowedParams() have been updated to calling getFinalParams instead, which gives the hook a chance to play with the paramters (add/remove) as needed.
Comment 2 Roan Kattouw 2008-08-28 21:56:35 UTC
(In reply to comment #1)
> Created an attachment (id=5225) [details]
> Implement ApiParams Hook
> 
> Basic implementation of an ApiParams hook. All uses calling getAllowedParams()
> have been updated to calling getFinalParams instead, which gives the hook a
> chance to play with the paramters (add/remove) as needed. 
> 

Stuff that's wrong with the patch:

* wfRunHooks() expects an array as its second argument
* $params should be passed as a reference
* hooks.txt needs to be updated
* You probably want other hooks in functions like getParamDescriptions() too (that's what I meant by "and friends")
Comment 3 Roan Kattouw 2008-09-06 12:38:29 UTC
Created attachment 5297 [details]
Improved patch

Improved stuff here and there and added a hook for getParamDescription() too
Comment 4 Roan Kattouw 2008-09-07 19:05:16 UTC
Patch applied in r40594.

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


Navigation
Links