Extension:Petition

From mediawiki.org
MediaWiki extensions manual
Petition
Release status: beta
Implementation Special page , Database
Description Adds includable Special:Petition to collect signatures for a petition, and Special:PetitionData for authorised users to download signatures as a CSV file.
Author(s) Peter Coombe (Pcoombe (WMF)talk)
MediaWiki 1.33+
PHP 5.4+
Database changes Yes
Tables petition_data
License GNU General Public License 2.0 or later
Download
  • $wgPetitionCountCacheTime
  • $wgPetitionDatabase
  • view-petition-data
Quarterly downloads 2 (Ranked 155th)
Translate the Petition extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

The Petition extension allows the collection of signatures (consisting of name, email, country and an optional personal message) for a petition. It adds Special:Petition which provides a form for signature collection, this is includable (and will normally be used that way). The extension also adds Special:PetitionData where authorized users can download the signatures as a csv file. The extension is initially intended to be deployed on https://wikimediafoundation.org.

Installation[edit]

  • Download and move the extracted Petition folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Petition
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Petition' );
    $wgGroupPermissions['petitiondata']['view-petition-data'] = true;
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

User rights[edit]

  • view-petition-data allows a user to view the log of signatures, and to download signatures for all petitions. Note that this can include real names and email addresses, so should be granted only to trusted users.

Features[edit]

  • Multiple named petitions can be created e.g. {{Special:Petition/freepuppies}} The petition name will be recorded with each signature.
  • A second parameter can be provided which will be recorded with signatures as the 'source'. So for example it is possible to include {{Special:Petition/freepuppies/a}} on one page and {{Special:Petition/freepuppies/b}} on another. Then in the results all signatures will be under the "freepuppies" petition, but it will also be possible to see which page the signatures were made on. This makes A/B testing possible.
  • Petition signatures (time and username/IP address) are logged in a private log, only visible to users with the view-petition-data right. There is also integration with Extension:CheckUser if it is installed on the wiki.

Dependency[edit]

See also[edit]