Skip to content

fix: handle null comment parameter in transaction endpoint#89

Merged
schinken merged 2 commits intostrichliste:masterfrom
Jolg42:fix/php8-mb_strlen-null-deprecation
Apr 12, 2026
Merged

fix: handle null comment parameter in transaction endpoint#89
schinken merged 2 commits intostrichliste:masterfrom
Jolg42:fix/php8-mb_strlen-null-deprecation

Conversation

@Jolg42
Copy link
Copy Markdown
Contributor

@Jolg42 Jolg42 commented Feb 19, 2026

Hello 👋🏼

It's my first PR here.
I'm a user of strichliste, we have it in my hacker space next to the drinks' fridge.

Because PHP 8.x emits a deprecation warning when passing null to mb_strlen().

This was breaking JSON responses when creating transactions without a comment.

Because PHP 8.x emits a deprecation warning when passing null to mb_strlen().

  This was breaking JSON responses when creating transactions without a comment.
Comment thread src/Controller/Api/TransactionController.php Outdated
Comment thread src/Controller/Api/TransactionController.php Outdated
throw new UserNotFoundException($userId);
}

$transaction = $transactionService->doTransaction($user, $amount, $comment, $quantity, $articleId, $recipientId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

$comment can be null if not provided and is stored as null

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, that makes sense indeed.

Co-authored-by: Christopher Schirner <christopher.schirner@thomann.io>
@schinken schinken merged commit 88ec9aa into strichliste:master Apr 12, 2026
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