As part of #1950632: Create a FieldDefinitionInterface and use it for formatters and widgets, we want to decouple formatters from $field and $instance config entities to allow greater reuse. Which means, we also need to decouple the helper functions that they call from these variables. _text_sanitize() is one such function. There's no need to pass it an entire config entity when all it needs is a single setting.

Also, considering all the places in core that invoke it, I don't think we can pretend it's a private function, so renaming it.

CommentFileSizeAuthor
text_sanitize.patch8.58 KBeffulgentsia
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Field API

Looks good to me.

yched’s picture

Same here :-)

webchick’s picture

Title: Narrow the API of _text_sanitize() and make it public » Change notice: Narrow the API of _text_sanitize() and make it public
Priority: Normal » Critical
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

This looks simple enough.

Committed and pushed to 8.x. Thanks!

Marking for change notice.

swentel’s picture

Status: Active » Needs review

Created change notice: http://drupal.org/node/1975504

andypost’s picture

Title: Change notice: Narrow the API of _text_sanitize() and make it public » Narrow the API of _text_sanitize() and make it public
Priority: Critical » Normal
Status: Needs review » Fixed

Looks good.

Also filed #1975538: Remove $text_processing argument from text_sanitize() as follow-up to check that we can drop this atgument

star-szr’s picture

Issue tags: -Needs change record

Tags.

Automatically closed -- issue fixed for 2 weeks with no activity.