Page MenuHomePhorge

Strip surrounding whitespace from project and task titles
Needs ReviewPublic

Authored by aklapper on Oct 29 2024, 10:34.

Details

Reviewers
valerio.bozzolan
Group Reviewers
O1: Blessed Committers
Summary

When creating or renaming a project or a task, copy and paste can lead to unwanted whitespace.
Thus strip any whitespace from the beginning and end of the title string by using trim() when running validateTransactions().

Test Plan
  • Create and rename projects and tasks with whitespace at the beginning and the end of their names. Confirm that the whitespace gets removed. Get correctly sorted database query search results, don't get notification mail saying Foo added a parent task: Txxxx: Title . anymore which annoys pedants like me.
  • Create and rename projects and tasks by setting the title to include whitespace only. Confirm that the error about being empty is shown.

Diff Detail

Repository
rP Phorge
Branch
stripTitleWhitespace (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1615
Build 1615: arc lint + arc unit

Event Timeline

Thanks. Seems good to me since trim($new) does not receive null so cannot create PHP 8.1 problems, since we already execute strlen($new) and mb_strlen($new) and that was not reporting errors in your updated install

This revision is now accepted and ready to land.Oct 29 2024, 12:11

This needs rework as the logic currently does not properly handle entering a title consisting of whitespace only. (Outcome gets unpleasant afterwards.)

Handle whitespace-only task and project titles correctly

This revision is now accepted and ready to land.Tue, Nov 26, 13:02