View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011523 | mantisbt | javascript | public | 2010-02-19 06:41 | 2011-08-29 07:05 |
Reporter | stappel | Assigned To | dhx | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Product Version | 1.2.0rc2 | ||||
Summary | 0011523: Ajax not defined on bug_update_page.php | ||||
Description | When visiting bug_update_page.php (which is bug_update_advanced_page.php) there are 3 "Ajax is not defined" errors in my firefox console. The javascript pages prototype.js and scriptaculous.js are not loaded. I solved it with editing the file: core/projax_api.php enables the projax library for this page.$g_enable_projax = true; into: enables the projax library for this page.global $g_enable_projax; | ||||
Tags | patch | ||||
Attached Files | |||||
it is on HEAD |
|
Unable to reproduce. I've also looked at the code and confirmed that projax_api.php is being loaded after html_api.php (thus $g_enable_projax = true). There is no need for "global $g_enable_projax;" unless projax_api.php is being included from a function and you want that function to make use of the global variables in projax_api.php. I've grepped the Mantis source code and projax_api.php is never included from within the scope of a function. It is always included from the global scope, thus making variables defined in projax_api.php global. I suggest you delete your MantisBT directory (after backing it up) and extract a fresh copy of MantisBT 1.2.0 in it's place. I'm guessing your directory has a mix of files from different versions of MantisBT. |
|
it is on the master branch in git. not on 1.2.0. i checked, i downloaded the 1.2.0 tar and it does not show the error. a "git checkout -f" gave me the error again on that page in firefox console2. if I edit projax.php and set a simple isset infront of the $g_enable_projax =true; like: on the page you can see it also because there is a big white field below the platform and os boxes. as you state it is not a var in a function there must be a problem with the sequence of the includes. |
|
I can't reproduce this problem on the latest 1.3.x master branch. AJAX support for the "Reporter" field on bug_update_page.php is working fine for me. Can I ask what version of PHP you are using? Have you tried: To reset your git directory to the exact same content as the git repository on git.mantisbt.org? Note that when using those commands above, it'll delete anything (including your configuration files) not in the official git repository. Do a backup first if you have something to lose. |
|
php -vPHP 5.2.12 (cli) (built: Jan 10 2010 14:24:47) git reset --hard origin/masterHEAD is now at ecb7cc0 Fix 0011565: $g_enable_profiles not respected on bug report page git clean -xfcp ../config_inc.php .The "Reporter" field works fine, it is the "Platform", "OS" and "OS version" which have the problem. |
|
I've got a similar problem and solved it by uninstalling jQuery-Plugin. |
|
I've pushed an update to the jQuery plugin that makes it cooperate with the Projax/Prototype libraries that MantisBT uses. You should be able to download or update to the latest version of that plugin, as well as any other plugins that rely on the jQuery plugin, to fix this problem. |
|
no jQuery plugin installed on my Mantis system |
|
Do you have any other plugins installed? |
|
Nope, can reproduce it on a clean download: #cd /var/www/html config_inc.php is my saved config the blank space is still there. See attached picture |
|
OK I can reproduce this now. Thanks for being patient. Will look into the problem and get a fix committed. |
|
The problem is that Projax and jQuery conflict with each other. MantisBT now includes jQuery code by default. I think it's best at this point to remove Projax from MantisBT entirely pending a new jQuery or HTML5 autocomplete feature. As such, please see 0009117 on progress towards removing Projax (and thus fixing this problem). |
|
Thanks for sorting this out. please reconsider the easy/quick fix by just adding global $g_enable_projax; |
|
@stappel: That "one line fix" doesn't appear to work in Mantis 1.2.1 |
|
Sorry that is what worked for me. have you tried uninstalling jQuery-Plugin? |
|
I discovered this problem today on my installation which I upgraded yesterday to 1.2.6. The quick fixes in core/projax_api.php didn't work for me and I didn't try to replace Projax with jQuery as that seems to be too complex of a change to do in a stable system. Instead I set "$g_use_javascript = OFF;" in config_inc.php which solved the problem for me. |
|