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

Already on GitHub? Sign in to your account

Fix: Trim URLSegment before applying replacements in filter #2871

Merged
merged 1 commit into from Mar 5, 2014

Conversation

Projects
None yet
3 participants
Contributor

feejin commented Feb 19, 2014

No description provided.

Contributor

simonwelsh commented Feb 20, 2014

You've marked this as a fix. What does it fix?

Contributor

feejin commented Feb 20, 2014

There's no issue for it but if you enter a page title with a space on the end (common with copy / pasted stuff) and Update URL the URLSegment will have a trailing dash in place of the space. This is something I can't see anyone ever really wanting.

Contributor

simonwelsh commented Feb 20, 2014

I feel that a better option would be to add a rule similar to this one that removes trailing hyphens, so that any other one that occurs during the filtering also gets removed. Then add a test or two to cover those cases.

Contributor

feejin commented Mar 2, 2014

I've changed this to use a rule and included tests. Had to amend an existing test as it resulted in a trailing dash so failed with this new rule.

Contributor

tractorcow commented Mar 3, 2014

@feejin You'll need to rebase and adjust this PR since your other PR was merged.

Contributor

feejin commented Mar 5, 2014

Updated this.

Contributor

tractorcow commented Mar 5, 2014

Thanks @feejin

Also, in future please use the standard commit tags (API, BUG, NEW). http://doc.silverstripe.org/framework/en/trunk/misc/contributing/code#commit-messages that will help us document changes. :)

tractorcow added a commit that referenced this pull request Mar 5, 2014

Merge pull request #2871 from feejin/urlsegment-trailing-space
BUG Trim URLSegment before applying replacements in filter

@tractorcow tractorcow merged commit cad8632 into silverstripe:3.1 Mar 5, 2014

1 check passed

default Scrutinizer: No new issues — Travis: Passed
Details
Contributor

simonwelsh commented Mar 5, 2014

Not using a tag is what we use for minor changes like this one, so is perfectly fine.

Contributor

tractorcow commented Mar 5, 2014

Fair enough!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment