• Dear Support Team,

    After upgrading to Trackserver 5.0.1, I have encountered an issue with the following line in my program:
    [tsmap user=UserName align=center zoom=13 color=blue live=t markers=e infobar=t weight=1 markers=true {displayname} – {lat},{lon} – {timestamp} – {speedkmh} – {distancekm1}]

    The map is moving, but the track and location are not being displayed. I would appreciate your assistance in finding a solution to this issue.

    Thank you for your time and support.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author tinuzz

    (@tinuzz)

    Hi,

    I looked at your page, and I think I see what is wrong.

    Trackserver uses a method named ‘gettrack’ to get track data from the server, and to call that method, it constructs a URL based on the ‘home URL’ of the website. In your case, Trackserver assesses that the ‘gettrack’ lives at https://an.hamilton.lv/index.php/trackserver/gettrack/. However, that URL doesn’t work. It doesn’t serve that track data, but instead, it redirects to a different URL, that isn’t handled by Trackserver.

    The problem appears to be the presence of the ‘index.php’ component in the URL. If I remove that, i.e. change it to https://an.hamilton.lv/trackserver/gettrack/, it seems to work fine.

    It is likely that this is a bug in Trackserver, however one that does not trigger in my setup. I’ll have to evaluate the way Trackserver constructs the URL, because I think the logic there may be wrong.

    Question: if you open the Tracks page in the WP backend and click in ‘View’ for a track, does it show then? I assume it doesn’t.

    If you need a quick fix, you’ll have to edit the plugin file called ‘class-trackserver.php‘. Go to line 253. It should read:

    $this->url_prefix = '/' . $wp_rewrite->index;

    Change it to:

    $this->url_prefix = '';

    That should make it work for now. I’ll try and fix this the right way as soon as possible.

    Regards,

    Martijn.

    Thread Starter HamiltonLV

    (@hamiltonlv)

    >Question: if you open the Tracks page in the WP backend and click in ‘>View’ for a track, does it show then? I assume it doesn’t.

    Yes, it displays fine.

    Thread Starter HamiltonLV

    (@hamiltonlv)

    Dear Martijn,

    Thanks to your recommendation, everything has been fixed and is now working properly.

    If you need a quick fix, you’ll have to edit the plugin file called ‘class-trackserver.php‘. Go to line 253. It should read:

    $this->url_prefix = '/' . $wp_rewrite->index;

    Change it to:

    $this->url_prefix = '';

    Regards,

    Alexander

    Plugin Author tinuzz

    (@tinuzz)

    Hi,

    Weird, the URL constuction mechanism in the backend is the same as in the frontend, so I don’t understand how one can work, and the other can not.

    Can you do something for me? In the WP admin, go to the Manage Tracks page and open the HTML source (press CTRL-u). Then, find the line that starts with ‘var track_base_url =‘, it should be somewhere near the bottom, and tell me the URL that’s in there? I’m mainly curious whether it contains ‘index.php‘ or not.

    In the mean time, I took a deeper dive into my own code and WP’s internal handling of rewrite rules and home URLs, and it kind of looks like I’m doing it the same way as WP itself is doing it, so I can’t quite figure out what it wrong just yet.

    Your site seems to have some sort of custom rewrite rule, rewriting ‘/index.php?abc=xyz’ to ‘/?abc=xyz’, but that seems to mess up Trackserver’s URLs in the front-end. Can you tell me whether you have something custom in place that does this redirect?

    Regards, Martijn.

    Thread Starter HamiltonLV

    (@hamiltonlv)

    Hi Martijn,

    Thank you for your help. I found the line you were asking about, it is:

    485 var track_base_url = {“track_base_url”:”http:\/\/an.hamilton.lv\/trackserver\/gettrack\/?”};

    And no, I haven’t made any custom changes to the site. If you need any additional information, I am ready to help.

    Best regards.

    Plugin Author tinuzz

    (@tinuzz)

    Hi Alexander,

    Asking you for the track_base_url was a bit silly, because after the change in the code, it was obviously not containing the ‘index.php’ anymore. But I don’t think it’s relevant.

    The problem with your WP instance, is that a URL like this:

    https://.../index.php/trackserver/gettrack/?query=...&p=1600&....

    is redirected to

    https://.../?page_id=1600&query=...&....

    So the essential trackserver/gettrack part of it disappears. That is why it isn’t working, but why the redirect is like that, I don’t know. In my own test setup, with permalinks disabled, there is also a redirect that removes the index.php part, but the trackserver/gettrack part is retained, and it works as it should.

    I’m not sure what to ask you at this point. I need a way to reproduce the problem, otherwise a fix will be hard to develop ??

    Which web server are you using (Apache, Nginx, other)? Which version of WordPress are you on?

    Regards, Martijn.

    Thread Starter HamiltonLV

    (@hamiltonlv)

    Dear Martijn,
    I wanted to let you know that I have decided to grant you access to our site as an Admin.
    Please note that this access is temporary and will only be available for a day or two. After that, I will remove the access. This is just a temporary measure so that you can take a look at the site and see if there is anything that needs to be updated.
    If you have any questions or concerns, please do not hesitate to reach out. I am always here to help.
    I need your email to grant access
    Best regards,
    Alexander

    Plugin Author tinuzz

    (@tinuzz)

    Hi Alexander,

    I’m not sure that’s a good idea. I would be more comfortable if you could provide me with some information. My current questions:

    • Which version of WordPress are you on?
    • Which webserver do you use?
    • If Apache, can you send met the .htaccess file from WordPress’ document root, if it exists?
    • Can you confirm that you have WordPress permalink structure set to ‘Plain’?

    Thanks,

    Martijn.

    Thread Starter HamiltonLV

    (@hamiltonlv)

    Dear Martijn,

    Thank you for your prompt response. Here is the requested information:

    1. WordPress current version: 6.1.1
    2. Server: Apache
    3. Here is the .htaccess file content:

    graphql

    AddHandler x-mapp-php5 .php3 .php4 .php .phtml

    BEGIN WordPress

    The directives (lines) between BEGIN WordPress and END WordPress

    are dynamically generated, and should only be modified via WordPress filters.

    Any changes made manually between these markers will be overwritten.

    END WordPress

    1. The permalink structure is set to ‘Plain’, URL format is: https://an.hamilton.lv/?p=123

    Let me know if you need anything else.

    Best regards,
    Alexander.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The map is moving, but the track and location are not being displayed.’ is closed to new replies.