#257 - New ticket page causes XHR for a URL that does not exist
Type Defect
Status Closed
Milestone 2.3.4
Version 2.3.3
Component Tickets
Priority Normal
Severity Normal
Owner Tilius
Assigned to -
Reported 11 years ago
Updated 10 years ago
Votes 0
Related tickets
Proposed time
Worked time

What did you do to cause this?

  1. Logged in, went to new ticket page of any project.

  2. Noticed that after approximately one second, some styles from my website's home page were being applied.

  3. Investigated via chrome -- the home page's stylesheet was being pulled in via an XHR originated from jquery on this page.

4a. The request was for "MYDOMAIN.com/development2/_ajax/ticket_template/1" (note /development2/ is where traq lives.) This URL does not exist on a fresh installation of Traq 2.3.3.

4b. As a result, the data it was pulling in was a redirection to the home page of MYDOMAIN.com (due to the URL not existing) which obviously has the home page stylesheet included.

What page were you on?

  • This happens on any new ticket page of any project, and only on this page.

What PHP and MySQL versions do you run?

  • php 5.3.3, mysql 14.14

Describe the defect:

  • See above note. Seems like this XHR should not be occurring. I am not proficient in javascript enough to determine why there is an XHR to get data at a URL that does not exist. I wonder if there are some mod_rewrite rules missing in an .htaccess for traq, as I can't find an "_ajax" directory anywhere in the traq release that I downloaded and installed (2.3.3)

Ticket History

11 years and 11 months ago by Jack

The reason behind the ajax request is for ticket templates, like the one you used for this ticket, see: http://traq.traqproject.org/_ajax/ticket_template/1

Traq has the .htaccess file that rewrites ALL 404-pages to it's index.php file, make sure you have uploaded the .htaccess file, I know sometimes it goes missing.

If the .htaccess file is uploaded, make sure you have the friendly URLs turned on in the AdminCP -> Settings panel. Also, on any page of your Traq install, view the page source and look for "var BASE_URL", copy the entire line, including the value of that variable.

11 years and 11 months ago by Tilius

There is no .htaccess file anywhere in the traq-2.3.3.zip that I downloaded from sourceforge. Can you provide it?

Friendly URLs are turned in in AdminCP, but my URLs look like this (I assume it's because I have no .htaccess) http://MYDOMAIN.com/development/index.php/ http://MYDOMAIN.com/development/index.php/project1 http://MYDOMAIN.com/development/index.php/project1/tickets

Here is BASE_URL: (I have since moved the traq installation from '/development2' to '/development') @var BASE_URL = "/development/";@

11 years and 11 months ago by Jack

Here's the .htaccess file for Traq 2.3: https://github.com/nirix/traq/blob/2.3/.htaccess

Not sure why it wasn't included in the archives, must have been the app used to create them.

11 years and 11 months ago by Tilius

I put the .htaccess you provided in the root directory of my traq install and things are working smoothly, ticket templates and other ajax calls as well. Thanks!

Jack closed as Closed 11 years and 11 months ago