########################################################################################## GPXIN-37: Incorrect variable reference causes warnings ########################################################################################## Issue Type: Bug ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Fixed (2019-03-14 17:21:44) Project: PHP GPXIngest (GPXIN) Reported By: btasker Assigned To: btasker Affected Versions: - 1.03 - 1.04 Targeted for fix in version: - 1.04 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== (Originally Github #20) The following snippet is incorrect -- BEGIN SNIPPET -- if (!$trkpt->desc && $this->$suppresscalcdistance){ $this->suppress('speed'); // Prevent warnings if speed is not available - See GPXIN-16 } -- END SNIPPET -- and causes the error Undefined variable: suppresscalcdistance. suppresscalcdistance is an attribute of the object, and not a variable containing the name of another attribute, so the dollar sign should not be there. ----------------------------------------------------------------------------------------- Issue Relations ================ - Caused by GPXIN-23: Move calcDistance out of Experimental Features - Github #20 (https://github.com/bentasker/PHP-GPX-Ingest/issues/20) ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2019-03-14 17:13:30 ----------------------------------------------------------------------------------------- btasker removed '1.02' from Version ----------------------------------------------------------------------------------------- 2019-03-14 17:14:29 btasker ----------------------------------------------------------------------------------------- This was introduced in GPXIN-23 when calcDistance was moved out of experimental and enabled by default: -- BEGIN SNIPPET -- - if (!$trkpt->desc && !$this->expisenabled('calcDistance')){ + if (!$trkpt->desc && $this->$suppresscalcdistance){ -- END SNIPPET -- The relevant commit is here - https://github.com/bentasker/PHP-GPX-Ingest/commit/88d7f93ab6c0088005b7bbc2d6dcacfe2ee013b1 ----------------------------------------------------------------------------------------- 2019-03-14 17:18:07 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: PHP-GPX-Ingest Commit: 1191958e0b493d5f1934bf53d4e7b0af60006e94 Author: B Tasker