Last modified: 2011-07-29 06:55:51 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 T32104, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30104 - EmailNotification::composeCommonMailtext became private in 1.17 which breaks extensions
EmailNotification::composeCommonMailtext became private in 1.17 which breaks ...
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Email (Other open bugs)
1.17.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-28 18:55 UTC by Dan Barrett
Modified: 2011-07-29 06:55 UTC (History)
1 user (show)

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


Attachments
Patch for this ticket (540 bytes, patch)
2011-07-28 18:56 UTC, Dan Barrett
Details

Description Dan Barrett 2011-07-28 18:55:25 UTC
In 1.17.0, the function EmailNotification::composeCommonMailtext() in UserMailer.php was changed from public to private. Could this change please be reversed? I have extensions that invoke/override this method and they've broken as a result.

Thank you very much.
Comment 1 Dan Barrett 2011-07-28 18:56:26 UTC
Created attachment 8831 [details]
Patch for this ticket
Comment 2 Dan Barrett 2011-07-28 19:02:26 UTC
Alternatively, is there an approved way to substitute a different subject line and body for a notification email, programmatically depending on circumstances?  In our extension, which watches only for changes to category pages, we subclass the EmailNotification class and override composeCommonMailtext like this:

class CategoryWatcherEmailNotification extends EmailNotification {
  var $mySubject;
  var $myBody;

  // Override the body and subject                                              
  function composeCommonMailtext() {
    $result = parent::composeCommonMailtext();
    if ($this->mySubject) { $this->subject = $this->mySubject; }
    if ($this->myBody) { $this->body = $this->myBody; }
  }
  ...

Then we attach to the LinksUpdate hook with a callback that creates a CategoryWatcherEmailNotification object (instead of an EmailNotification) and runs notifyOnPageChange().
Comment 3 Dan Barrett 2011-07-28 19:17:56 UTC
Never mind, you can close this ticket. I figured out that I can override sendPersonalised() instead of composeCommonMailtext().

Now please don't make sendPersonalised() private. :-)
Comment 4 p858snake 2011-07-29 06:55:51 UTC
+patch

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


Navigation
Links