GPXIN-37: Incorrect variable reference causes warnings

Issue Information

Issue Type: Bug
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: PHP GPXIngest (GPXIN)
Resolution: Fixed (2019-03-14 17:21:44)
Affects Version: 1.03, 1.04,
Target version: 1.04,

Created: 2019-03-14 17:11:59
Time Spent Working

(Originally Github #20)

The following snippet is incorrect
if (!$trkpt->desc && $this->$suppresscalcdistance){
      $this->suppress('speed'); // Prevent warnings if speed is not available - See GPXIN-16

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 Links

Github #20
Toggle State Changes


btasker removed '1.02' from Version
This was introduced in GPXIN-23 when calcDistance was moved out of experimental and enabled by default:
-                                       if (!$trkpt->desc && !$this->expisenabled('calcDistance')){
+                                       if (!$trkpt->desc && $this->$suppresscalcdistance){

The relevant commit is here -

Repo: PHP-GPX-Ingest
Commit: 1191958e0b493d5f1934bf53d4e7b0af60006e94
Author: B Tasker <github@<Domain Hidden>>

Date: Thu Mar 14 17:14:57 2019 +0000
Commit Message: GPXIN-37 - BUGFIX: object attribute is incorrectly referenced resulting in PHP warnings

Raised in Github #20

Modified (-)(+)

Webhook User-Agent


View Commit

btasker changed status from 'Open' to 'Resolved'
btasker added 'Fixed' to resolution
btasker changed status from 'Resolved' to 'Closed'