Skip to content

Please make Inputfield notes trim spaces/newlines #562

@BernhardBaumrock

Description

@BernhardBaumrock

When working with inputfields you can add notes like this from the API:

$f->notes = 'I have something to say...';

This is great. However, this will overwrite any notes that the inputfield might have had set before. This might be intentional or might not.

If you do want to keep previously set notes, you can do this:

$f->notes .= "\nThis is a new note";

Easy, right? Not quite. The problem here is that if the field did not have any notes it will lead to an empty newline at the beginning of the note.

This is my fix:

$f->notes .= $f->notes ? "\n" : '';
$f->notes .= 'My new note';

But this is tedious! Could the admin trim spaces and newlines from notes automatically?

Thx in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions