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

FIX handle non breakable spaces #11163

Merged
merged 1 commit into from
Mar 11, 2024
Merged

Conversation

lekoala
Copy link
Contributor

@lekoala lekoala commented Mar 1, 2024

Fixes issue #11162
and very likely will also deal with #10626

I've targeted this to 5.1 but it probably also apply to 4.x but i don't know if it's worth it to apply the patch there as well

Description

See relevant issue

Manual testing steps

See relevant issue

Issues

Related

also see https://www.php.net/manual/en/class.numberformatter.php#129192

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@GuySartorelli
Copy link
Member

Looks like it might be a sensible solution, can you please add a test so we don't get a regression of this in the future?

@michalkleiner
Copy link
Contributor

We were dealing with something similar recently in Matomo core and we are replacing U+202F and U+2009, so perhaps worth adding that one in here as well, some numeric formats may use that as well.

@lekoala
Copy link
Contributor Author

lekoala commented Mar 2, 2024

diving into the unit tests, the issue was already known but somehow added back by this commit
029a8b9

it also seems that the test was never updated and was doing it's own little cleaning up, which was hiding the issue. I've refactored the cleaning method into a function (and added U+2009 as @michalkleiner suggested) and updated the tests so that they test properly formatted values (meaning, including the narrow non breaking space... i added a comment next to each line, this is really easy to miss if the editor doesn't outline somehow the utf8 character)

@michalkleiner
Copy link
Contributor

Nice work @lekoala! Also good you tracked it's a regression. Can you rebase and retarget at 4.13, please?

@lekoala lekoala changed the base branch from 5.1 to 4.13 March 4, 2024 07:38
@lekoala lekoala changed the base branch from 4.13 to 5.1 March 4, 2024 07:38
@lekoala
Copy link
Contributor Author

lekoala commented Mar 4, 2024

@michalkleiner if you have an easy way to do that i'm happy to, but changing the target branch always ends up adding tons of commits and most of the time, it's actually faster to create a new PR rather than updating this one.
:-) so either I need to find a decent workflow to rebase and retarget a PR, or I'm happy to create a new one to replace this

@michalkleiner
Copy link
Contributor

michalkleiner commented Mar 4, 2024

@michalkleiner if you have an easy way to do that i'm happy to, but changing the target branch always ends up adding tons of commits and most of the time, it's actually faster to create a new PR rather than updating this one. :-) so either I need to find a decent workflow to rebase and retarget a PR, or I'm happy to create a new one to replace this

I can rebase it for you if you've enabled the option for maintainers to update the code.

Usually the easiest way is to squash the commits locally into a single good one, create a temp branch with it, reset the PR branch to the top of 4.13 and then cherry pick the commit. Should be no conflicts or easy to resolve. Then force push the updated branch and change PR target. Delete the temp branch.

(You can do it without the temp branch if you force-push twice and use the remote as your temp, there's multiple ways.)

@lekoala
Copy link
Contributor Author

lekoala commented Mar 4, 2024

@michalkleiner ok, if you are up to do it, i'll let you do that :-) you should be able to edit the PR
image

@GuySartorelli
Copy link
Member

@michalkleiner were you going to take a look at retargetting this PR?

@michalkleiner
Copy link
Contributor

Ah, missed Thomas's comment last week, will do it today.

@michalkleiner michalkleiner changed the base branch from 5.1 to 4.13 March 11, 2024 20:55
@GuySartorelli
Copy link
Member

GuySartorelli commented Mar 11, 2024

CI might try to install from the 5.1 branches since you changed the base branch after pushing changes - if it does, you may need to force push again to get it running correctly.

@michalkleiner
Copy link
Contributor

@GuySartorelli re-pushed after the target change and CI still ✅

Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, LGTM.
Thanks for fixing this @lekoala and thanks for the help @michalkleiner

@GuySartorelli GuySartorelli merged commit c8c2695 into silverstripe:4.13 Mar 11, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants