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.
We need to port the D7 feeds_tamper Truncate Text plugin to D8 tamper.
Comment | File | Size | Author |
---|---|---|---|
#5 | interdiff-1-5.txt | 5.85 KB | mitrpaka |
#5 | truncate_text-2976188-5.patch | 5.32 KB | mitrpaka |
| |||
#2 | 2976188_1.patch | 3.07 KB | sivaramakrishnan |
| |||
#2 | plugin-page-3.png | 52.49 KB | sivaramakrishnan |
#2 | plugin-page-2.png | 50.09 KB | sivaramakrishnan |
Comments
Comment #2
sivaramakrishnan CreditAttribution: sivaramakrishnan as a volunteer and commentedPlease Apply the Here attached Patch and this patch for port the Truncate Text Plugin from D7 to D8.
Comment #3
ericgsmith CreditAttribution: ericgsmith as a volunteer commentedHi @sivaramakrishnan - thanks for the patch. Looks like a good start.
This will need the settings definitions added to tamper.schema.yml and a test. A few minor comments below.
We should use $this->t for translated strings.
Can this method be simplified? If wordsafe is a boolean value, do we need the if statment or can we just return Unicode::truncate($data, $this->getSetting(self::SETTING_NUM_CHAR), $this->getSetting(self::SETTING_WORDSAFE), $this->getSetting(self::SETTING_ELLIPSE));
Comment #4
vijay.mayilsamy CreditAttribution: vijay.mayilsamy as a volunteer and at Dialed In Design commentedHi,
I have made all the above requested changes and Added the test cases.
Add Ellipses test case fails for some reason. Attached the patch here
@James, Could you please take a look and let me know what the problem is ?
Thanks
Vijay
Comment #5
mitrpaka CreditAttribution: mitrpaka as a volunteer commentedRe-rolled and updated latest patch.
Comment #6
jamesdixon CreditAttribution: jamesdixon at Dialed In Design commentedThanks for jumping in on this @mitrpaka.
Tests are still passing okay.
I have reviewed the code and @ericgsmith's suggestions have been covered from #3
Looks good to me!
Comment #8
ericgsmith CreditAttribution: ericgsmith as a volunteer commentedThanks all! Apologies for the delay in committing this.