########################################################################################## GPXIN-25: Multiple Track Support not Working ########################################################################################## Issue Type: Bug ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Fixed (2016-02-13 11:55:04) Project: PHP GPXIngest (GPXIN) Reported By: btasker Assigned To: btasker Affected Versions: - 1.02 Targeted for fix in version: - 1.02 Time Estimate: 10 minutes Time Logged: 10 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Reported in Github #5 -- BEGIN QUOTE -- i have file with many trk in one gpx-file... but your script work only with LAST trk-section in xml... you could introduce support for these files? thanks -- END QUOTE -- ----------------------------------------------------------------------------------------- Attachments ============ - 20130518.gpx.zip ----------------------------------------------------------------------------------------- Issue Relations ================ - Github #5 (https://github.com/bentasker/PHP-GPX-Ingest/issues/5) ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2016-02-13 10:57:08 btasker ----------------------------------------------------------------------------------------- Nice catch - that's a bug. The script is supposed to support multiple tracks, however, whilst it iterates over them it fails to increase the numeric key used for that track (or within the codebase - journey) and so essentially overwrites the previously processed tracks. Variable is defined here - https://github.com/bentasker/PHP-GPX-Ingest/blob/master/GPXIngest.class.php#L232 Used here - https://github.com/bentasker/PHP-GPX-Ingest/blob/master/GPXIngest.class.php#L243 But never incremented ----------------------------------------------------------------------------------------- 2016-02-13 10:57:21 btasker ----------------------------------------------------------------------------------------- Attaching provided example GPX ----------------------------------------------------------------------------------------- 2016-02-13 10:57:21 ----------------------------------------------------------------------------------------- btasker added '20130518.gpx.zip' to Attachments ----------------------------------------------------------------------------------------- 2016-02-13 11:00:04 ----------------------------------------------------------------------------------------- btasker changed timespent from '0 minutes' to '5 minutes' ----------------------------------------------------------------------------------------- 2016-02-13 11:00:52 btasker ----------------------------------------------------------------------------------------- Have just committed a fix. It's possible it'll interfere with the overall file stats, though it doesn't read as though it should. Should also look at renaming the variable to something more meaningful ----------------------------------------------------------------------------------------- 2016-02-13 11:01:27 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: PHP-GPX-Ingest Commit: 51efb6a76bcfb48c48efec26a649029f333c90ea Author: B Tasker