CommentFileSizeAuthor
#72 2089471-remove-check_plain-72.patch61.61 KBlongwave
#70 2089471-remove-check_plain-70.patch61.55 KBianthomas_uk
#67 interdiff.txt2.21 KBlongwave
#67 2089471-remove-check_plain-67.patch61.55 KBlongwave
#65 interdiff.txt943 byteslongwave
#65 2089471-remove-check_plain-65.patch61.38 KBlongwave
#61 interdiff-59-61.patch2.35 KBianthomas_uk
#61 check_plain_to_String_checkPlain-2089471-61.patch60.97 KBianthomas_uk
#59 check_plain_to_String_checkPlain-2089471-59.patch60.9 KBianthomas_uk
#53 check_plain_to_String_checkPlain-2089471-53.patch94.45 KBInternetDevels
#48 check_plain_to_String_checkPlain-2089471-48.patch95.24 KBInternetDevels
#41 check_plain_to_String_checkPlain-2089471-41.patch136.5 KBnetsensei
#41 interdiff.txt745 bytesnetsensei
#39 interdiff.txt412 bytesnetsensei
#38 check_plain_to_String_checkPlain-2089471-38.patch136.07 KBnetsensei
#36 check_plain_to_String_checkPlain-2089471-36.patch135.78 KBvolkerk
#34 check_plain_to_String_checkPlain-2089471-34.patch136.21 KBvolkerk
#34 interdiff.check_plain_to_String_checkPlain-2089471-34.txt4.75 KBvolkerk
#31 check_plain_to_String_checkPlain-2089471-31.patch136.15 KBvolkerk
#31 interdiff.check_plain_to_String_checkPlain-2089471-31.txt3.06 KBvolkerk
#29 check_plain_to_String_checkPlain-2089471-29.patch136.17 KBvolkerk
#27 check_plain_to_String_checkPlain-2089471-27.patch136.09 KBrpsu
#27 interdiff.check_plain_to_String_checkPlain-2089471-27.txt858 bytesrpsu
#24 check_plain_to_String_checkPlain-2089471-23.patch136.07 KBrpsu
#23 check_plain_to_String_checkPlain-2089471-23.patch136.07 KBrpsu
#19 check_plain_to_String_checkPlain-2089471-17.patch138.95 KBrpsu
#15 check_plain_to_String_checkPlain-2089471-15.patch137.94 KBrpsu
#12 check_plain_to_String_checkPlain-2089471-10.patch23.18 KBsandipmkhairnar
#10 2089471-10.patch144.35 KBsidharthap
#8 2089471-8.patch144.48 KBsidharthap
#6 2089471-6.patch155.35 KBsidharthap
#3 2089471-3.patch144.77 KBsidharthap
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

littledynamo’s picture

sidharthap’s picture

Assigned: Unassigned » sidharthap

Assigning it.

sidharthap’s picture

Status: Active » Needs review
FileSize
144.77 KB

1st patch from M to Z

littledynamo’s picture

Removed tag

Status: Needs review » Needs work

The last submitted patch, 2089471-3.patch, failed testing.

sidharthap’s picture

Status: Needs work » Needs review
FileSize
155.35 KB

Corrected patch.

Status: Needs review » Needs work

The last submitted patch, 2089471-6.patch, failed testing.

sidharthap’s picture

Status: Needs work » Needs review
FileSize
144.48 KB

Status: Needs review » Needs work

The last submitted patch, 2089471-8.patch, failed testing.

sidharthap’s picture

Status: Needs work » Needs review
FileSize
144.35 KB

Status: Needs review » Needs work

The last submitted patch, 2089471-10.patch, failed testing.

sandipmkhairnar’s picture

Remove check_plain() in core to Drupal\Component\Utility\String::checkPlain().

mcrittenden’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-10.patch, failed testing.

rpsu’s picture

Most of references to check_plain() replaced. However there are still a couple issues

  • menu_test.module // menu_test_menu() has callback to check_plain in one menuitem, which I do not know what to do with
  • views declares also String class (twice) and I am not sure if that class is the one to use inside views or not [currently String::checkPlain]
jibran’s picture

Status: Needs work » Needs review

.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-15.patch, failed testing.

thedavidmeister’s picture

views declares also String class (twice) and I am not sure if that class is the one to use inside views or not [currently String::checkPlain]

If something is using check_plain() currently, you want to use \Drupal\Component\Utility\String::checkPlain() after conversion. If "String" is already in the current namespace, you'll have to use aliases - something like "viewsString" and "UtilityString" probably makes sense.

menu_test.module // menu_test_menu() has callback to check_plain in one menuitem, which I do not know what to do with

Do menu callbacks support array('\Drupal\Component\Utility\String', 'checkPlain') syntax?

rpsu’s picture

Views check_plain: I think right way is to go with Drupal\Component\Utility\String with an alias since basically that is the one to use for replacing check_plain() (instead of String class declared by Views).

Menu-item: I could not find any other callbacks which would use array('\Drupal\Component\Utility\String', 'checkPlain') -kind of syntax, actually there is not one anywhere else (which I could find).

rpsu’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-17.patch, failed testing.

thedavidmeister’s picture

From the coding standards at https://drupal.org/node/1353118

PHP allows classes to be aliased when they are imported into a namespace. In general that should only be done to avoid a name collision. If a collision happens, alias both colliding classes by prefixing the next higher portion of the namespace.

rpsu’s picture

Status: Needs work » Needs review
FileSize
136.07 KB

Let's try again.

rpsu’s picture

Let's try again.

rpsu’s picture

Sorry for the double post. Files are the same.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-23.patch, failed testing.

rpsu’s picture

Forgot to give an alias to String (collision with views's String), now fixed.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-27.patch, failed testing.

volkerk’s picture

Status: Needs work » Needs review
FileSize
136.17 KB

Re-rolling with aliased UtilityString class, fixed typo.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-29.patch, failed testing.

volkerk’s picture

volkerk’s picture

Status: Needs work » Needs review

run tests

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-31.patch, failed testing.

volkerk’s picture

Hopefully got them all now, see #22. Aliasing Drupal\Component\Utility\String might not be the correct solution.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-34.patch, failed testing.

volkerk’s picture

Status: Needs work » Needs review
FileSize
135.78 KB

rerolling #34

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-36.patch, failed testing.

netsensei’s picture

Status: Needs work » Needs review
FileSize
136.07 KB

Chasing head and fixing a missing use statement in user.module.

netsensei’s picture

FileSize
412 bytes

... and the interdiff.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-38.patch, failed testing.

netsensei’s picture

Status: Needs work » Needs review
FileSize
745 bytes
136.5 KB

New attempt.

This one *will* fail however on the Menu tests. However, I've somewhat isolated it's cause: 'description callback' in menu_test does not support the array syntax per #18 and #19. See: core/includes/menu.inc => _menu_item_localize().

The same also goes for title_callback.
1/ No support for the syntax above
2/ Around line 673 this happens:

    if ($title_callback == 'check_plain') {
      $item['localized_options']['html'] = TRUE;
    }

I'd suggest opening up a separate issue which fixes that before we can get back here.

Status: Needs review » Needs work

The last submitted patch, check_plain_to_String_checkPlain-2089471-41.patch, failed testing.

rpsu’s picture

Would it not be enought to fix this and other alike callback test? After all it is just a test to see if stuff is already plain-texted.

if ($title_callback == array('\Drupal\Component\Utility\String', 'checkPlain)')) {
  $item['localized_options']['html'] = TRUE;
}
netsensei’s picture

I don't think so.

1. re: title_callback == array('\Drupal\Component\Utility\String', 'checkPlain)')

$title_callback can either be a string (function name) or an array (method call). Since the type of $title_callback is ambiguous, I don't think a condition like this could work.

2. We should think further then just menu_test. It's not because this is the first and only occurrence of String::checkPlain in core, it's not possible that someone will try to call other core class methods or contrib class methods as a *_callback.

I think this merits further discussion in a separate issue.

See: #2101803: Allow class methods to be set as menu *_callback

netsensei’s picture

Hm.

I think this issue is blocked because description_callback in menu_test.module is not supporting the new static checkPlain() method.

#2076085: Resolve the need for a 'title callback' using the route pretty much converts title_callback to the new yml _title_callback property. There is no similar conversion for description_callback at this point, though.

However, since hook_menu is being phased out for the new routing system, I wonder if we can work around this by either:

1. Ignoring check_plain() functionality in to-be removed hooks like hook_menu alltogether
2. Change the test to use the new _title_callback functionality instead, but that needs to be checked of with the routing/menu maintainers.
3. Wait until someone comes up with a decent _description_callback compatibility within the routing system.

thedavidmeister’s picture

We could unblock the bulk of the conversion by splitting this issue into smaller issues.

sun’s picture

Issue summary: View changes
Issue tags: +@deprecated
InternetDevels’s picture

Status: Needs work » Needs review
FileSize
95.24 KB

new try

Status: Needs review » Needs work

The last submitted patch, 48: check_plain_to_String_checkPlain-2089471-48.patch, failed testing.

The last submitted patch, 48: check_plain_to_String_checkPlain-2089471-48.patch, failed testing.

dimaro’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 48: check_plain_to_String_checkPlain-2089471-48.patch, failed testing.

InternetDevels’s picture

FileSize
94.45 KB

new try.

snig’s picture

Status: Needs work » Needs review

changed status for patch testing.

Status: Needs review » Needs work

The last submitted patch, 53: check_plain_to_String_checkPlain-2089471-53.patch, failed testing.

InternetDevels’s picture

InternetDevels’s picture

A half of those patches are for views modules.
Seems that this issue is too big to be done at once.

I have created separated task for views/views_ui modules:
#2187829: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in core/modules/views

ianthomas_uk’s picture

Assigned: sidharthap » ianthomas_uk

Re-rolling now

ianthomas_uk’s picture

Title: Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in core/modules/M-Z (except views/views_ui) » Convert all calls to check_plain() in core to Drupal\Component\Utility\String::checkPlain() in core/modules/M-Z (except system/simpletest)
Assigned: ianthomas_uk » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
FileSize
60.9 KB

This is a reroll after the views issue got in, plus it fixes 3 uses in array_map.

There were lots that still needed replacing in the system module, but simpletest had some that could prove tricky (simpletest.install scares me) and we've already got a 66k patch so I'll split those into a separate issue.

I've removed references to views from the issue title/summary, as if the odd one slips back in this is now the right issue to fix it in.

Status: Needs review » Needs work

The last submitted patch, 59: check_plain_to_String_checkPlain-2089471-59.patch, failed testing.

ianthomas_uk’s picture

Status: Needs work » Needs review
FileSize
60.97 KB
2.35 KB

The array_map uses needed to be fully qualified.

Status: Needs review » Needs work

The last submitted patch, 61: interdiff-59-61.patch, failed testing.

The last submitted patch, 61: check_plain_to_String_checkPlain-2089471-61.patch, failed testing.

The last submitted patch, 61: check_plain_to_String_checkPlain-2089471-61.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review
FileSize
61.38 KB
943 bytes
ianthomas_uk’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
    @@ -145,7 +146,7 @@ protected function renderEntityFields(ContentEntityInterface $entity, EntityView
    +   * @see String::checkPlain()
    

    Classes should be fully qualified (i.e. start \Drupal) in @see blocks.

  2. +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php
    @@ -84,7 +85,7 @@ protected function renderLink($data, ResultRow $values) {
             // This is an anonymous user, and we're overriting the text.
    

    Are we allowed to fix this spelling mistake as we're making a change next to it (overriting > overwriting)?

  3. +++ b/core/modules/user/user.module
    @@ -564,7 +565,7 @@ function user_preprocess_block(&$variables) {
    - *   this result must ensure that check_plain() is called on it before it is
    + *   this result must ensure that String::checkPlain() is called on it before it is
    

    Over 80 characters

I've checked the rest of the patch, including making sure no function parameters have been changed and broken by a reroll, and it all looks good. I think we can RTBC once these nitpicks are fixed.

longwave’s picture

Status: Needs work » Needs review
FileSize
61.55 KB
2.21 KB

Fixed all items in #66. I agree we should fix the spelling error now while it's been noted.

ianthomas_uk’s picture

Status: Needs review » Reviewed & tested by the community

That fixes my concerns, assuming the tests pass this is RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

2089471-remove-check_plain-67.patch no longer applies.

error: patch failed: core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php:2995
error: core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php: patch does not apply

ianthomas_uk’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
FileSize
61.55 KB

Reroll. Just a context change in WebTestBase, theme > _theme, so back to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

2089471-remove-check_plain-70.patch no longer applies.

error: patch failed: core/modules/user/user.module:564
error: core/modules/user/user.module: patch does not apply

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
61.61 KB
ianthomas_uk’s picture

Status: Needs review » Reviewed & tested by the community

Just context changes, looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

2089471-remove-check_plain-72.patch no longer applies.

error: patch failed: core/modules/user/user.module:1
error: core/modules/user/user.module: patch does not apply

thedavidmeister’s picture

Status: Needs work » Postponed

This is postponed on a disruptive day (see parent issue).

ianthomas_uk’s picture

Status: Postponed » Closed (duplicate)

This was fixed on the meta