Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBText::Summary only adds ellipsis to the first sentence #9965

Open
michalkleiner opened this issue Jun 3, 2021 · 1 comment
Open

DBText::Summary only adds ellipsis to the first sentence #9965

michalkleiner opened this issue Jun 3, 2021 · 1 comment

Comments

@michalkleiner
Copy link
Contributor

Affected Version

4.8 latest

Description

Looking at the code at https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/FieldType/DBText.php#L120, it seems the $add is only added to the first sentence if it's longer than $maxWords.
It's not used after line https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/FieldType/DBText.php#L144 to append to the second or other sentences.

Steps to Reproduce

Provide a text with two or more sentences and set maxWords to fall in the middle of the second sentence.

@michalkleiner
Copy link
Contributor Author

Found this issue when working on tests for #9696. Once that's merged in, a test case for this issue can be added to the providerSummary provider there.

@michalkleiner michalkleiner changed the title DBText::Summary only adds ellipsis to the first sentence only DBText::Summary only adds ellipsis to the first sentence Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants