Kaldari has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92827
Change subject: Changing usage instructions for ContentHandler::getContentText()
......................................................................
Changing usage instructions for ContentHandler::getContentText()
Although I understand why we want developers to use getContent()
and getContentHandler(), there are numerous situations where the
developer is sure the content is going to be TextContent, and thus
ContentHandler::getContentText() is a really useful convenience
function. Rather than prohibiting it for anything besides
backwards compatibility, I think it would make more sense to just
provide a warning that it is a convenience function only intended
for certain uses.
Change-Id: I811e3a5975d5dd0da1fb5d7961d2340dfd58b41d
---
M includes/content/ContentHandler.php
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/27/92827/1
diff --git a/includes/content/ContentHandler.php
b/includes/content/ContentHandler.php
index 2a92e23..1c9b485 100644
--- a/includes/content/ContentHandler.php
+++ b/includes/content/ContentHandler.php
@@ -65,9 +65,10 @@
protected static $enableDeprecationWarnings = false;
/**
- * Convenience function for getting flat text from a Content object.
This
- * should only be used in the context of backwards compatibility with
code
- * that is not yet able to handle Content objects!
+ * Convenience function for getting flat text from a Content object.
+ *
+ * NOTE: This should only be used with content that is known to be
TextContent, for
+ * example, a wikitext revision.
*
* If $content is null, this method returns the empty string.
*
--
To view, visit https://gerrit.wikimedia.org/r/92827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I811e3a5975d5dd0da1fb5d7961d2340dfd58b41d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits