Page MenuHomePhabricator

What I did to get the print_r result

Authored By
01tonythomas
Jun 25 2015, 3:28 PM
Size
2 KB
Referenced Files
None
Subscribers
None

What I did to get the print_r result

diff --git a/includes/SpecialNewsletters.php b/includes/SpecialNewsletters.php
index be4375a..6ffc228 100644
--- a/includes/SpecialNewsletters.php
+++ b/includes/SpecialNewsletters.php
@@ -68,6 +68,10 @@ class SpecialNewsletters extends SpecialPage {
* @return bool
*/
static function onSubscribe( array $formData ) {
+ echo "The subscribe part";
+ print_r( $formData );
+ $wasPosted = RequestContext::getMain()->getRequest()->wasPosted();
+ echo "subscribe action was $wasPosted";
if ( isset( $formData['available-newsletters'] ) && isset( $formData['subscriber'] ) ) {
$dbr = wfGetDB( DB_SLAVE );
//get newsletter id user is subscribing to
@@ -123,6 +127,7 @@ class SpecialNewsletters extends SpecialPage {
}
$newsletterNames = array();
+ $defaultOption = array( '' => null );
//get newsletter names
foreach ( $newsletterIds as $value ) {
$result = $dbr->select(
@@ -138,9 +143,9 @@ class SpecialNewsletters extends SpecialPage {
return array(
'subscribed-newsletters' => array(
'required' => true,
- 'type' => 'selectorother',
+ 'type' => 'select',
'label' => $this->msg( 'subscribed-newsletters-field-label' )->text(),
- 'options' => $newsletterNames
+ 'options' => array_merge( $defaultOption, $newsletterNames )
),
'un-subscriber' => array(
'type' => 'hidden',
@@ -156,6 +161,10 @@ class SpecialNewsletters extends SpecialPage {
* @return bool
*/
static function onUnSubscribe( array $formData ) {
+ echo "The unsubscribe part";
+ print_r( $formData );
+ $wasPosted = RequestContext::getMain()->getRequest()->wasPosted();
+ echo "Unsubscribe action was $wasPosted";
if ( isset( $formData['subscribed-newsletters'] ) && isset( $formData['un-subscriber'] ) ) {
$dbr = wfGetDB( DB_SLAVE );
//remove entry from subscriptions table
(END)

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
176278
Default Alt Text
What I did to get the print_r result (2 KB)

Event Timeline