Difference between revisions of "Template:Bulk Update"
From FollowTheScore
(New page: <p style=background-color:#ffdddd>Use this page with care. It will perform updates on the wiki text of many articles simultaneously.</p> {{#form: name=pageupdate | action=/wiki/index.php |...) |
(No difference)
|
Revision as of 11:51, 27 February 2009
Use this page with care. It will perform updates on the wiki text of many articles simultaneously.
{{#form: name=pageupdate | action=/wiki/index.php | {{#input: name=title | type=hidden | value=Special:Call/Bulk_Update }}
update all articles matching these criteria | Apply the following changes | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Type exec into the mode field to perform the update or leave empty to preview changes:
mode | {{#input: name=mode | value= }} | |
---|---|---|
edit summary | {{#input: name=summary | value= }} | {{#input: type=submit| name=submit }} reset form |
}} <javascript src="setFocus1.js" />
{{#vardefine:skip|dummy}}
- The pattern for title matching is used in a SQL-LIKE expression; so %Foo% will match all articles with a name containing Foo. The pattern may or may not be case sensitive - depending on the database settings in your wiki. So %foo% might in some cases match an article named The Foos and in other cases not.
- The pattern used to match wiki content follows php regexp syntax. It refers to the raw wiki text - including template parameters. Note that you MUST use delimiters like / around the pattern. Be careful when using symbols like the pipe character - they must be 'escaped' by backslashes.
- If you leave all parameters on the right hand side empty you will get a list of all wiki articles that match your selection criteria.
- As soon as you enter something into the right hand side form fields you will see the raw wiki text of all artricles on which your replacement rules will work. Note that NO CHANGE is done to those wiki articles, however, until you enter exec in the third parameter section (see below).
- The replace parameter expects a regular expression; here you you can also add modifiers if you want. Use grouping for back references. Example: "/(ab?c+)def/i" would match "xyaCcccdeFx". If you replace the matching part of the wiki text by zz\1ghi you will get xyzzaCcccghix.
- If you see an error message complaining about empty Delimiters you probably forgot to put slashes around the regular expressions.
- The positions where text is inserted (before and after) are also regular expressions. But in this case slashes are put around automatically by the source code of this template - so you must not use delimiters here. Modify the source code of this page if you want to change this.
- Because mediaWiki internally strips white space around template arguments special care is needed when leading or trailing spaces are significant for your position pattern. Leading or trailing spaces must be written as \s when specifying positions, line feeds must be written as \n.
- The content to insert is normal text. Notet that you must use the special symbols " « ¦ » " instead of " < | > ". Leading and trailing spaces are stripped. As a work around you can make two successive replacements where you first insert an arbitrary unique pattern plus the spaces and then remove that special marker pattern in a second round of updates.
- You must enter the literal exec into the mode field to really perform the update. Otherwise you will get a list of pages with the modified wiki text. Depending on the number and size of the articles you have selected this list can become quite large.
- The execution may take some time. The updates will be made under your user and the summary text will contain the update rules. You can add additional text which will be prepended to the summary. After the update you will be forwarded to the last page which was changed. If you run into CPU limitations this will help you to find out how many pages were updated. To catch the remaining pages you will have to adapt the selction criteria, e.g. by the use of a name pattern for page titles.
- clicking on reset form clears all fields and takes you back to this eplanation.