Procházet zdrojové kódy

Fix trait method collision between JellyStatHomepageItem and HomepageUserWatchStats

- Resolved fatal error: formatDuration method collision
- Used trait conflict resolution to prioritize JellyStatHomepageItem::formatDuration
- Added alias formatDurationSeconds for HomepageUserWatchStats::formatDuration
- This fixes the 500 Internal Server Error when JellyStatHomepageItem trait is enabled
mgomon před 9 měsíci
rodič
revize
84fbe9d0f7
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      api/classes/organizr.class.php

+ 4 - 2
api/classes/organizr.class.php

@@ -66,8 +66,10 @@ class Organizr
 	use WeatherHomepageItem;
 	use uTorrentHomepageItem;
 	use UptimeKumaHomepageItem;
-	use HomepageUserWatchStats;
-	//use JellyStatHomepageItem;
+	use HomepageUserWatchStats, JellyStatHomepageItem {
+		JellyStatHomepageItem::formatDuration insteadof HomepageUserWatchStats;
+		HomepageUserWatchStats::formatDuration as formatDurationSeconds;
+	}
 
 	// ===================================
 	// Organizr Version