[PR #1842] [MERGED] fix(editing songs): track number removed when editing multiple songs #1900

Closed
opened 2026-02-26 03:32:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/1842
Author: @ShetlandJ
Created: 10/7/2024
Status: Merged
Merged: 11/3/2024
Merged by: @phanan

Base: masterHead: 1740-editing-songs-bug


📝 Commits (4)

  • 85cf9af fix(editing songs): fix track number removal when editing multiple songs
  • 46e5550 fix(editing songs): add some more tests
  • 607a7cc fix(editing songs): revert some issues
  • 3cfd548 fix(tracks disappearing): remove unused func

📊 Changes

2 files changed (+192 additions, -8 deletions)

View changed files

📝 app/Services/SongService.php (+22 -8)
tests/Integration/Services/SongServiceTest.php (+170 -0)

📄 Description

Fixes #1740

The current editing song process contains a bug where if the user selects to edit multiple songs and leaves the track blank, the track numbers are removed. This is because the data object that is passed contains track: null, which the system takes as the user's choice, when the user has positively decided to leave it blank.

The change makes an initial check if the user is editing multiple songs, and if so, if the user has left track as blank.

Also added some unit tests for SongService.php to confirm the logic, which required adding a new factory for SongUpdateData.php.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/koel/koel/pull/1842 **Author:** [@ShetlandJ](https://github.com/ShetlandJ) **Created:** 10/7/2024 **Status:** ✅ Merged **Merged:** 11/3/2024 **Merged by:** [@phanan](https://github.com/phanan) **Base:** `master` ← **Head:** `1740-editing-songs-bug` --- ### 📝 Commits (4) - [`85cf9af`](https://github.com/koel/koel/commit/85cf9afaeda07e47e431fcdc77f3561bcd6210a5) fix(editing songs): fix track number removal when editing multiple songs - [`46e5550`](https://github.com/koel/koel/commit/46e5550a20d0bd0022f27e44d225e470cddff63e) fix(editing songs): add some more tests - [`607a7cc`](https://github.com/koel/koel/commit/607a7cc81031a32142aeb823449f45b402e5ab8f) fix(editing songs): revert some issues - [`3cfd548`](https://github.com/koel/koel/commit/3cfd548e3dc3a7113603b0e6e105bad72dfcabc9) fix(tracks disappearing): remove unused func ### 📊 Changes **2 files changed** (+192 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `app/Services/SongService.php` (+22 -8) ➕ `tests/Integration/Services/SongServiceTest.php` (+170 -0) </details> ### 📄 Description Fixes #1740 The current editing song process contains a bug where if the user selects to edit multiple songs and leaves the track blank, the track numbers are removed. This is because the data object that is passed contains `track: null`, which the system takes as the user's choice, when the user has positively decided to leave it blank. The change makes an initial check if the user is editing multiple songs, and if so, if the user has left `track` as blank. Also added some unit tests for `SongService.php` to confirm the logic, which required adding a new factory for `SongUpdateData.php`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 03:32:42 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#1900
No description provided.