Empty Province/State Table

Ask your questions regarding TimeTrex installation here.
Locked
toones
Posts: 26
Joined: Fri Oct 05, 2007 8:52 pm

Empty Province/State Table

Post by toones »

For some reason, the province/state table has become empty. The zip version installed fine, and I was able to create a company (which means the province/state table WAS populated), but now the table is empty. Would you tell me where the script is to recreate that particular table? Here are the results of the debug:

(postgres7): select session_id,user_id,ip_address,created_date,updated_date from authentication WHERE session_id = ? AND ip_address = ? AND updated_date >= ? [ (session_id=>'e9f0d9a06db23d3a326f5b4be5ec1aa5') (ip_address=>'68.111.237.67') (updated_date=>'1191843402') ] (postgres7): update authentication set updated_date = ? where session_id = ? [ (updated_date=>'1191857802') (session_id=>'e9f0d9a06db23d3a326f5b4be5ec1aa5') ] (postgres7): select * from station where company_id = ? AND station_id = ? AND deleted = 0 [ (company_id=>'1') (station_id=>'b8a07bfc30c3a28075d1fe3925af90b2') ] (postgres7): select * from cron WHERE deleted = 0 ORDER BY last_run_date DESC LIMIT 1 (postgres7): select d.severity_id as severity_id, count(*) as count from exception as a LEFT JOIN user_date as b ON a.user_date_id = b.id LEFT JOIN users as c ON b.user_id = c.id LEFT JOIN exception_policy as d ON a.exception_policy_id = d.id LEFT JOIN pay_period as e ON b.pay_period_id = e.id where b.user_id = ? AND b.date_stamp < ? AND e.status_id = ? AND NOT EXISTS ( select z.id from request as z where z.user_date_id = a.user_date_id AND z.status_id = 30 ) AND ( a.deleted = 0 AND b.deleted = 0 AND e.deleted=0) GROUP BY d.severity_id ORDER BY d.severity_id desc [ (user_id=>'1') (date_stamp=>'2007-10-08') (status_id=>'10') ] (postgres7): select name FROM bread_crumb WHERE user_id = ? AND name = ? LIMIT 1 [ (user_id=>'1') (name=>'Edit Company') ] (postgres7): UPDATE bread_crumb SET url = ?, created_date = ? WHERE user_id = ? AND name = ? [ (url=>'/TimeTrex/interface/company/EditCompany.php?id=1') (created_date=>'1191857802') (user_id=>'1') (name=>'Edit Company') ] /tmp/timetrex//9b/adodb_9bfe6a1c139c82942026e34ad0c3c70c.cache reloaded, ttl=29625 [ select * from company where id = -1 ]
(postgres7): select * from company WHERE deleted = 0 order by status_id asc,name asc /tmp/timetrex//17/adodb_175031b5c99ccabd86c9cf26c19f045a.cache reloaded, ttl=29902 [ select * from users where id = -1 ]
(postgres7): select * from users where company_id = ? AND deleted = 0 order by status_id asc,last_name asc [ (company_id=>'1') ]

Debug Buffer
============================================================================
Memory Usage: 7110592
----------------------------------------------------------------------------
DEBUG [243]: [Function](): URI: /TimeTrex/interface/company/EditCompany.php?id=1
DEBUG [245]: [Function](): Production: 0
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: GMT
DEBUG [497]: Authentication::Check(): Session Name: SessionID
DEBUG [503]: Authentication::Check(): Session ID: e9f0d9a06db23d3a326f5b4be5ec1aa5
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:e9f0d9a06db23d3a326f5b4be5ec1aa5
DEBUG [78]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [302]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:e9f0d9a06db23d3a326f5b4be5ec1aa5
DEBUG [69]: [Function](): User Authenticated: jchesser Created Date: 1191857309
DEBUG [1907]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [100]: TTDate::setTimeZone(): Setting TimeZone: US/Pacific-New
DEBUG [129]: TTDate::setDateFormat(): Setting Default Date Format: d-M-y
DEBUG [143]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [157]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
DEBUG [100]: [Function](): Locale Cookie: en_US
DEBUG [235]: TTi18n::getLanguageFromLocale(): Locale: en_US
DEBUG [108]: [Function](): User Preference Language matches cookie!
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 6 Current Locale:
DEBUG [273]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [291]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [309]: TTi18n::setLocale(): Set Locale To: en_US
DEBUG [1907]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [1102]: UserPreferenceFactory::isPreferencesComplete(): User Preferences IS Complete:
DEBUG [136]: [Function](): Station ID Cookie found! b8a07bfc30c3a28075d1fe3925af90b2
DEBUG [243]: [Function](): UnRead Messages: 0
DEBUG [48]: BreadCrumb::setCrumb(): Dropping Bread Crumb: Edit Company URL: /TimeTrex/interface/company/EditCompany.php?id=1
============================================================================

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 34.5979 ms (12.86 %) Authentication::Check()
1 20.0861 ms (7.47 %) Interface.inc - Check for Exceptions
1 10.4239 ms (3.88 %) Interface.inc - Check for UNREAD messages...
2 2.4228 ms (0.90 %) getEmptyRecordSet()
1 119.1950 ms (44.31 %) unprofiled

82.2735 ms (30.59 %) Missed
============================================================================
268.9991 ms (100.00 %) OVERALL TIME
============================================================================
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Its not a table, they are hardcoded in TimeTrex itself.

Chances are there something broken that is causing the AJAX portion of TimeTrex to not work. Do you have the installer enable flag set in the timetrex.ini.php by chance?
toones
Posts: 26
Joined: Fri Oct 05, 2007 8:52 pm

Post by toones »

The ini file reads installer_enabled=false. Is this the correct setting after install? If so, is there something else I can check to see if it is in fact a broken AJAX issue (is something else tied to AJAX that shouldn't be working)?
Finally, is there a way to fix it without blowing out the DB?

I don't know if country is hardcoded and tied to AJAX, country is working fine.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Can you paste your entire timetrex.ini.php file here?

As well, check your PHP/Apache error logs for anything suspicious.

This is almost certainly tied to AJAX directly, as it changes the provinces/states based on the country you select.

Oh yeah, and if you are using Firefox, check Tools -> Error Console to see if there are any Javascript errors.
toones
Posts: 26
Joined: Fri Oct 05, 2007 8:52 pm

Post by toones »

;
;
; TimeTrex Configuration File
; *Linux* Example
;
;

;
; System paths. NO TRAILING SLASHES!
;
[path]
;URL to TimeTrex web root directory. ie: http://your.domain.com/<*BASE_URL*>
;DO NOT INCLUDE http://your.domain.com, just the directory AFTER your domain
base_url = /TimeTrex/interface

;
;log directory
;
;Linux
log = /var/log/timetrex

;
;Misc storage, for attachments/images
;
;Linux
storage = /var/timetrex/storage

;
;Full path and name to the PHP CLI Binary
;
;Linux
php_cli = /usr/bin/php



;
; Database connection settings. These can be set from the installer.
;
[database]
;type = mysqlt
type = postgres8

host = localhost
database_name = timetrex
user = timetrex
password = timetrex



;
; Cache settings
;
[cache]
enable = TRUE
;Linux
dir = /tmp/timetrex



[debug]
;Set to false if you're debugging
production = TRUE

enable = FALSE
enable_display = FALSE
buffer_output = TRUE
enable_log = TRUE
verbosity = 10



[other]
; Force all clients to use SSL.
force_ssl = FALSE
installer_enabled = FALSE
primary_company_id = 1

;WARNING: DO NOT CHANGE THIS AFTER YOU HAVE INSTALLED TIMETREX.
;If you do it will cause all your passwords to become invalid,
;and you may lose access to some encrypted data.
salt = 1d6470113d2a4f6b2425c29881307aa7

;<? if (; //Cause parse error to hide from prying eyes, just in case. DO NOT REMOVE?>


Lots of Javascript errors in FireFox. I will PM you an admin login/password so you can see those.

The only error in the apache error log is dircetly related to the issue: [Mon Oct 08 04:04:04 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: province in /var/www/html/TimeTrex/interface/company/EditCompany.php on line 76, referer: http://x.x.x.x:x/TimeTrex/interface/company/EditCompany.php?id=1
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I logged into your system and the province/state selection works fine for me.

I would try clearing your browser cache, see if that helps.
toones
Posts: 26
Joined: Fri Oct 05, 2007 8:52 pm

Post by toones »

You are right. Clearing the cache (or shift-refresh) resolved the issue.

I am sorry for wasting your time.
zmeikov
Posts: 9
Joined: Fri Jul 13, 2012 11:38 am

Re: Empty Province/State Table

Post by zmeikov »

I am having similar issue.

Province / State: drop down is not populated in both EditUserDefault.php and EditUser.php, but country is set to United States.

Cleaning browser cache and cookies did not helped. I tried Firefox, Chrome and IE with same result.

could not find any PHP errors that I could relate to any AJAX issues.

Please see the attached files
Attachments
server errors.pdf
(50.23 KiB) Downloaded 298 times
timetrex - EditUserDefault.pdf
(383.52 KiB) Downloaded 450 times
TimeTrex 5.0.7 standard (manual ZIP install) hosted on BlueHost
PHP version 5.2.17 / PostgreSQL 8.4.12 / Apache version 2.2.22
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Empty Province/State Table

Post by shaunw »

Could you email support@timetrex.com the URL to your TimeTrex instance and username/password for us to login as so we can test it ourselves?
zmeikov
Posts: 9
Joined: Fri Jul 13, 2012 11:38 am

Re: Empty Province/State Table

Post by zmeikov »

UPDATE: After installing a chrome extension the following javascript error came up:

Error: Request Timed Out: time out was 20000ms [http://www.dcpower.cc/timetrex/interfac ... erver:1979]

I manually tried going to

http://www.dcpower.cc/timetrex/interfac ... erver:1979

and

http://www.dcpower.cc/timetrex/interfac ... JAX_Server

I have attached the returned text to this post.
Attachments
AJAX_Server-1979.txt
(87 KiB) Downloaded 281 times
AJAX_Server-.txt
(90.47 KiB) Downloaded 299 times
TimeTrex 5.0.7 standard (manual ZIP install) hosted on BlueHost
PHP version 5.2.17 / PostgreSQL 8.4.12 / Apache version 2.2.22
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Empty Province/State Table

Post by shaunw »

The data returned looks fine to me, did it take a long time to return that data?

A request timeout that that took over 20 seconds to respond, seems like a slow server issue to me. It appears that you are on a shared hosting server as well, so that wouldn't be out of the ordinary.

I would still recommend sending us a login so we can test it for ourselves, without a login the URL you sent won't work.

I should also mention that if debugging verbosity is set to 11 (which it was in your previous screenshots) that this functionality will definitely not work along with most other functionality. Debug verbosity set to 11 is meant for extensive debugging and not regular operation.
zmeikov
Posts: 9
Joined: Fri Jul 13, 2012 11:38 am

Re: Empty Province/State Table

Post by zmeikov »

It took 1 or 2 seconds to retrieve the text. Not long at all.

I sent login information to support@timetrex.com. Have you been able to duplicate the issue?

timetrex.log has some entries which i think tell AJAX is working fine:

Code: Select all

DEBUG [L0067] [165ms]:	<b>[Function]()</b>: AJAX Server called...<br>
---------------[ Thu, 26 Jul 2012 11:01:28 -0600 (PID: 25730) ]---------------

---------------[ Thu, 26 Jul 2012 11:01:51 -0600 (PID: 25847) ]---------------
DEBUG [L0386] [6ms]:	<b>[Function]()</b>: URI: /timetrex/interface/ajax_server.php?&c=AJAX_Server&m=getProvinceOptions IP Address: 208.64.88.174<br>
DEBUG [L0388] [6ms]:	<b>[Function]()</b>: Version: 5.0.7 Edition: 10 Production: 1 Demo Mode: 0<br>
DEBUG [L0167] [72ms]:	<b>TTDate::setTimeZone()</b>: Setting TimeZone: America/Denver<br>
DEBUG [L0634] [98ms]:	<b>Authentication::Check()</b>: Session ID: 003dd30114cd195d3861b5f211da803b IP Address: 208.64.88.174 URL: /timetrex/interface/ajax_server.php?&c=AJAX_Server&m=getProvinceOptions<br>
DEBUG [L0103] [117ms]:	<b>[Function]()</b>: User Authenticated: admin Created Date: 1343314147<br>
DEBUG [L2636] [117ms]:	<b>UserFactory::isInformationComplete()</b>: User Information is Complete: <br>
DEBUG [L0167] [126ms]:	<b>TTDate::setTimeZone()</b>: Setting TimeZone: MST7MDT<br>
DEBUG [L0197] [126ms]:	<b>TTDate::setDateFormat()</b>: Setting Default Date Format: d-M-y<br>
DEBUG [L0211] [126ms]:	<b>TTDate::setTimeFormat()</b>: Setting Default Time Format: g:i A<br>
DEBUG [L0225] [126ms]:	<b>TTDate::setTimeUnitFormat()</b>: Setting Default Time Unit Format: 10<br>
DEBUG [L0142] [129ms]:	<b>[Function]()</b>: Locale Cookie: en_US<br>
DEBUG [L0305] [129ms]:	<b>TTi18n::getLanguageFromLocale()</b>: Locale: en_US<br>
DEBUG [L0150] [130ms]:	<b>[Function]()</b>: User Preference Language matches cookie!<br>
DEBUG [L0334] [130ms]:	<b>TTi18n::setLocale()</b>: Generated/Passed In Locale: <br>
DEBUG [L0270] [130ms]:	<b>TTi18n::generateLocale()</b>: Array of Locales to try in order for "": en_US,en_US.UTF-8,en,en.UTF-8<br>
DEBUG [L0228] [130ms]:	<b>TTi18n::tryLocale()</b>: Found valid locale: en_US<br>
DEBUG [L0340] [130ms]:	<b>TTi18n::setLocale()</b>: Attempting to set Locale(s) to: en_US Category: 6 Current Locale: <br>
DEBUG [L0343] [130ms]:	<b>TTi18n::setLocale()</b>: Setting currency/numeric Locale to: en_US<br>
DEBUG [L0356] [134ms]:	<b>TTi18n::setLocale()</b>: Setting translator to normalized locale: en_US<br>
DEBUG [L0376] [134ms]:	<b>TTi18n::setLocale()</b>: Set Master Locale To: en_US<br>
DEBUG [L2636] [134ms]:	<b>UserFactory::isInformationComplete()</b>: User Information is Complete: <br>
DEBUG [L2025] [134ms]:	<b>UserPreferenceFactory::isPreferencesComplete()</b>: User Preferences IS Complete: <br>
DEBUG [L0170] [134ms]:	<b>[Function]()</b>: Station ID Cookie found! 63089ec52b9c214abd29dacb39f7da2d<br>
DEBUG [L1615] [153ms]:	<b>Misc::detectMobileBrowser()</b>: User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 Retval: <br>
DEBUG [L0060] [164ms] Array: <b>AJAX_Server::getProvinceOptions()</b>: aCountry: 
<pre>string(2) "US"

</pre><br>
DEBUG [L0070] [164ms] Array: <b>AJAX_Server::getProvinceOptions()</b>: bCountry: 
<pre>array(1) {
  [0]=>
  string(2) "US"
}

</pre><br>
DEBUG [L0067] [168ms]:	<b>[Function]()</b>: AJAX Server called...<br>
---------------[ Thu, 26 Jul 2012 11:01:51 -0600 (PID: 25847) ]---------------
manually going to /interface/ajax_server.php?&c=AJAX_Server&m=getProvinceOptions
returns false.
TimeTrex 5.0.7 standard (manual ZIP install) hosted on BlueHost
PHP version 5.2.17 / PostgreSQL 8.4.12 / Apache version 2.2.22
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Empty Province/State Table

Post by shaunw »

I logged in and the country/province fields are working for me in Google Chrome (v18) on Linux and Internet Explorer (v9) on Windows. Though after a few tries I noticed there would be a significant delay before the province options would appear, but once they loaded the first time it would be fairly fast after that.

Based on that I would say TimeTrex is working fine, but there is something with your server or the internet connection that is causing the slow down and/or a timeout to occur, which is resulting in no province/states appearing in the list of course.
zmeikov
Posts: 9
Joined: Fri Jul 13, 2012 11:38 am

Re: Empty Province/State Table

Post by zmeikov »

Thanks for all the help. I found out what is the cause of the issue: Ad Muncher.

Even though I disabled filtering, it seemed HTTP requests were still going trough it. After exiting the application completely, State/Province field populated properly in all browsers.

HTTP filtering apps like Ad Muncher, Antiviruses etc might cause grief with AJAX requests.

Thanks again for the help.
TimeTrex 5.0.7 standard (manual ZIP install) hosted on BlueHost
PHP version 5.2.17 / PostgreSQL 8.4.12 / Apache version 2.2.22
Locked