+++ b/core/modules/contact/src/MessageViewBuilder.php
@@ -55,7 +56,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
+ // @todo Improve \Drupal\Core\Mail\MailFormatHelper::htmlToText() to convert DIVs correctly.
+++ b/core/modules/contact/src/MessageViewBuilder.php
@@ -55,7 +56,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
+ // @todo Improve \Drupal\Core\Mail\MailFormatHelper::htmlToText() to convert DIVs correctly.
+++ b/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
@@ -37,7 +38,7 @@ protected function stringToHtml($text) {
+ * Helper function for testing \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+++ b/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
@@ -66,7 +67,7 @@ protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL
+ * Test all supported tags of \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+++ b/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
@@ -161,10 +162,11 @@ public function testTags() {
+ * Test $allowed_tags argument of \Drupal\Core\Mail\MailFormatHelper::htmlToText().
git ac https://www.drupal.org/files/issues/remove_usage_of-2358999-24.patch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9064 100 9064 0 0 24552 0 --:--:-- --:--:-- --:--:-- 27056
error: patch failed: core/modules/system/src/Tests/Mail/HtmlToTextTest.php:8
error: core/modules/system/src/Tests/Mail/HtmlToTextTest.php: patch does not apply
One of the deprecated function removal has caused this to need a reroll. The drupal_strtolower() - make sure when reroll to not reintroduce a usage of that function.
git ac https://www.drupal.org/files/issues/2358999-27.patch
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9078 100 9078 0 0 6724 0 0:00:01 0:00:01 --:--:-- 9301
error: patch failed: core/modules/system/src/Tests/Mail/HtmlToTextTest.php:48
error: core/modules/system/src/Tests/Mail/HtmlToTextTest.php: patch does not apply
+++ b/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
@@ -38,7 +39,8 @@ protected function stringToHtml($text) {
- * Helper function for testing drupal_html_to_text().
+ * Helper function for testing
+ * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
@@ -67,7 +70,8 @@ protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL
- * Test all supported tags of drupal_html_to_text().
+ * Test all supported tags of
+ * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
@@ -162,10 +166,12 @@ public function testTags() {
- * Test $allowed_tags argument of drupal_html_to_text().
+ * Test $allowed_tags argument of
+ * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
@@ -331,7 +337,8 @@ public function testDrupalHtmlToTextParagraphs() {
- * Tests that drupal_html_to_text() wraps before 1000 characters.
+ * Tests that \Drupal\Core\Mail\MailFormatHelper::htmlToText() wraps before
+ * 1000 characters.
All too long. The coding standard is that the first line of a method doc block should fit on one line.
--- a/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
+++ b/core/modules/system/src/Tests/Mail/HtmlToTextTest.php
@@ -39,8 +39,7 @@ protected function stringToHtml($text) {
}
/**
- * Helper function for testing
- * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+ * Helper function to test \Drupal\Core\Mail\MailFormatHelper::htmlToText().
*
* @param $html
* The source HTML string to be converted.
@@ -70,8 +69,7 @@ protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL
}
/**
- * Test all supported tags of
- * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+ * Tests supported tags of \Drupal\Core\Mail\MailFormatHelper::htmlToText().
*/
public function testTags() {
global $base_path, $base_url;
@@ -166,8 +164,7 @@ public function testTags() {
}
/**
- * Test $allowed_tags argument of
- * \Drupal\Core\Mail\MailFormatHelper::htmlToText().
+ * Tests allowing tags in \Drupal\Core\Mail\MailFormatHelper::htmlToText().
*/
public function testDrupalHtmlToTextArgs() {
// The second parameter of \Drupal\Core\Mail\MailFormatHelper::htmlToText()
@@ -337,8 +334,7 @@ public function testDrupalHtmlToTextParagraphs() {
}
/**
- * Tests that \Drupal\Core\Mail\MailFormatHelper::htmlToText() wraps before
- * 1000 characters.
+ * Tests \Drupal\Core\Mail\MailFormatHelper::htmlToText() wrapping.
*
* RFC 3676 says, "The Text/Plain media type is the lowest common
Comments
Comment #1
aczietlow commentedI used the folowing to find all usages of drupal_html_to_text excluding any usages in a vendor directory.
> git grep --after-context 8 '@deprecated' | grep "drupal_html_to_text" | grep -v 'core/vendor' | rev | cut -c 2- | rev
The depreciated function will still need to be removed in another patch.
Comment #2
jeroentCreated issue to remove the function drupal_html_to_text: #2359069: Remove drupal_html_to_text()..
Comment #3
ec1ipsis commentedUpdated patch file to fix some commenting code style issues.
Comment #5
rpayanmrerolling...
Comment #6
quietone commentedWorks for me.
Grep doesn't return any "drupal_html_to_text" instances and tests on the changed modules pass.
Comment #7
javivf commentedI do a reroll to apply patch
Comment #10
rpayanmComment #11
aczietlow commented@javivf It's unclear to me what this reroll (#7) was for? Should we be removing form_set_cache() or replacing decode_entities() for this?
Comment #12
rpayanm@aczietlow yes It's a strange patch :( let me make a reroll.
Comment #13
quietone commentedPatch from #12 works for me.
Grep doesn't return any "drupal_html_to_text" instances, tests passed.
Comment #14
aczietlow commentedConfirming that #12 passes all tests and has no usages of drupal_html_to_text().
Comment #15
rpayanmThen RTBC :D
Comment #16
herom commentedWe shouldn't change drupal_wrap_mail() here.
Comment #17
rpayanm@herom thank you, nice catch!
fixed!
Comment #18
jeroentPatch looks RTBC!
Comment #19
jeroentComment #21
jeroentComment #22
pushpinderchauhan commentedComment #23
rpayanmComments must be <= 80 characters per line.
Comment #24
jeroentMade some changes as suggested by rpayanm in #23. Patch attached.
Comment #25
rpayanmIt's nice for me.
Comment #26
alexpottComment #27
rpayanmrerolling...
Comment #28
rpayanmComment #29
aspilicious commentedComment #30
alexpottPlease add this issue to the relevant CR
Comment #31
jeroentComment #32
alexpottOne of the deprecated function removal has caused this to need a reroll. The drupal_strtolower() - make sure when reroll to not reintroduce a usage of that function.
Comment #33
rpayanmComment #34
aspilicious commentedComment #35
rpayanmReferenced this issue on the following change record: #1992584: New Unicode component.
Comment #36
quietone commentedLooks good to me. grep only finds the functions drupal_strtolower and drupal_html_to_text.
Though I think the modified change record is actually https://www.drupal.org/node/2309379
Comment #37
alexpottAll too long. The coding standard is that the first line of a method doc block should fit on one line.
Here is a suggestion.
Comment #38
rpayanm@alexpott thank you, then here the patch.
Comment #39
rpayanmMinor changes so RTBC...
Comment #40
alexpottThis issue is a prioritized change as per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase? and it's benefits outweigh any disruption. Committed 5528695 and pushed to 8.0.x. Thanks!