Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There's 7 usages in CORE using same code to encode the Tags. We copy and paste it over and over again. It makes hard to maintain the code. And less possible to add custom encode rule to the Tags.
Proposed resolution
Add a shared method to \Drupal\Component\Utility\Tags class
Remaining tasks
- Review patch
User interface changes
- N / A
API changes
- added a new method in \Drupal\Component\Utility\Tags class
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff_do-not-test.patch | 517 bytes | droplet |
#10 | tags-encode-10.patch | 8.2 KB | droplet |
Comments
Comment #1
amateescu CreditAttribution: amateescu commentedThis makes perfect sense.
The function receives a string, not an array :) And the text might be changed to "A tag string."
Comment #3
droplet CreditAttribution: droplet commentedFixed the errors
Comment #5
droplet CreditAttribution: droplet commentedremove extra end quote
Comment #7
droplet CreditAttribution: droplet commentedIt should work this time.
Comment #8
droplet CreditAttribution: droplet commentedComment #9
amateescu CreditAttribution: amateescu commentedPlease see #1. Also, the method description should be something like:
Encodes a tag string, taking care of special cases like commas and quotes.
Comment #10
droplet CreditAttribution: droplet commentedUpdate the comments.
Comment #11
amateescu CreditAttribution: amateescu commentedLooks good now.
Comment #12
catchCommitted/pushed to 8.x, thanks!
Could use a change record for the API addition.
Comment #13
jessebeach CreditAttribution: jessebeach commentedChange record added and reviewed. This was a simple API method addition.
Comment #14
jessebeach CreditAttribution: jessebeach commented