Defect #7265
"Loading..." icon does not disappear after add project member
| Status: | Closed | Start date: | 2011-01-10 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Project settings | |||
| Target version: | 1.1.1 | |||
| Affected version: | 1.1.0 | Resolution: | Fixed |
Description
"Loading..." icon does not disappear after I have finished to add project member.
- Firefox 3.6.13 (Mac)
- Safari 5.0.3 (Mac)
Associated revisions
Fixed: "Loading..." icon does not disappear after adding a project member when there is no other member to add (#7265).
History
#1 Updated by Jean-Philippe Lang over 1 year ago
Can not reproduce with Firefox 3.6.13 or Chrome 8 under Windows.
Do you have javascript error or something that could help?
#2 Updated by Etienne Massip over 1 year ago
Got same with FF 4b9.
Here the content of HTTP response to POST request http://localhost:3000/projects/test1/members/new :
Element.update("tab-content-members", "\n\n\n\u003Cdiv class=\"splitcontentleft\"\u003E\n\n\u003Ctable class=\"list members\"\u003E\n\t\u003Cthead\u003E\u003Ctr\u003E\n\t \u003Cth\u003EUser / Group\u003C/th\u003E\n\t \u003Cth\u003ERoles\u003C/th\u003E\n\t \u003Cth style=\"width:15%\"\u003E\u003C/th\u003E\n \n\t\u003C/tr\u003E\u003C/thead\u003E\n\t\u003Ctbody\u003E\n\t\n\t\n\t\u003Ctr id=\"member-2\" class=\"odd member\"\u003E\n\t\u003Ctd class=\"user\"\u003E\u003Ca href=\"/users/1\"\u003ERedmine Admin\u003C/a\u003E\u003C/td\u003E\n \u003Ctd class=\"roles\"\u003E\n \u003Cspan id=\"member-2-roles\"\u003EManager\u003C/span\u003E\n \n \u003Cform action=\"/members/edit/2\" class=\"hol\" id=\"member-2-roles-form\" method=\"post\" onsubmit=\"new Ajax.Request('/members/edit/2', {asynchronous:true, evalScripts:true, method:'post', parameters:Form.serialize(this)}); return false;\"\u003E\u003Cdiv style=\"margin:0;padding:0;display:inline\"\u003E\u003Cinput name=\"authenticity_token\" type=\"hidden\" value=\"/RN8aP8OZobvnfvvXdAIWOAOJXhNrQnQpCBnZiH48L0=\" /\u003E\u003C/div\u003E\n \t\u003Cp\u003E\n \u003Clabel\u003E\u003Cinput checked=\"checked\" id=\"member_role_ids_\" name=\"member[role_ids][]\" type=\"checkbox\" value=\"3\" /\u003E Manager\u003C/label\u003E\u003Cbr /\u003E\n \n \u003Clabel\u003E\u003Cinput id=\"member_role_ids_\" name=\"member[role_ids][]\" type=\"checkbox\" value=\"4\" /\u003E Developer\u003C/label\u003E\u003Cbr /\u003E\n \n \u003Clabel\u003E\u003Cinput id=\"member_role_ids_\" name=\"member[role_ids][]\" type=\"checkbox\" value=\"5\" /\u003E Reporter\u003C/label\u003E\u003Cbr /\u003E\n \u003C/p\u003E\n \u003Cinput id=\"member_role_ids_\" name=\"member[role_ids][]\" type=\"hidden\" value=\"\" /\u003E\n \u003Cp\u003E\u003Cinput class=\"small\" name=\"commit\" type=\"submit\" value=\"Change\" /\u003E\n \u003Ca href=\"#\" onclick=\"$('member-2-roles').show(); $('member-2-roles-form').hide(); return false;; return false;\"\u003ECancel\u003C/a\u003E\u003C/p\u003E\n \u003C/form\u003E\n \n \u003C/td\u003E\n \u003Ctd class=\"buttons\"\u003E\n \u003Ca class=\"icon icon-edit\" href=\"#\" onclick=\"$('member-2-roles').hide(); $('member-2-roles-form').show(); return false;; return false;\"\u003EEdit\u003C/a\u003E\n \u003Ca class=\"icon icon-del\" href=\"#\" onclick=\"new Ajax.Request('/members/destroy/2', {asynchronous:true, evalScripts:true, method:'post', parameters:'authenticity_token=' + encodeURIComponent('/RN8aP8OZobvnfvvXdAIWOAOJXhNrQnQpCBnZiH48L0=')}); return false;\" title=\"Delete\"\u003EDelete\u003C/a\u003E\n \u003C/td\u003E\n \n\t\u003C/tr\u003E\n\n\t\u003C/tbody\u003E\n\u003C/table\u003E\n\n\u003C/div\u003E\n\n\n\n\n\u003Cdiv class=\"splitcontentright\"\u003E\n\n\u003C/div\u003E\n");
hideOnLoad()
new Effect.Highlight("member-2",{});
May be a missing semi-colon after hideOnLoad() call ?
Note : I tried to paste response within a "code class="javascript" block" but previewing or submitting the message then cause a HTTP 500 error.
#3 Updated by Etienne Massip over 1 year ago
And no javascript error or warning in Firebug console.
#4 Updated by Etienne Massip over 1 year ago
Etienne Massip wrote:
Got same with FF 4b9.
Here the content of HTTP response to POST request
http://localhost:3000/projects/test1/members/new:[...]
May be a missing semi-colon after
hideOnLoad()call ?Note : I tried to paste response within a "
code class="javascript"block" but previewing or submitting the message then cause a HTTP 500 error.
Also note that trying to use syntax highlighting on this piece of javascript code may bring your server down ; I just killed http://coderay.rubychan.de and my own Redmine server this way.
Luckily, redmine.org is still up.
About this issue, this is not a browser bug as it can also be reproduced with IE8. Ajax' OnComplete() is never called.
#5 Updated by Kornelius Kalnbach over 1 year ago
I'll try to fix this CodeRay bug ASAP.
#6 Updated by Kornelius Kalnbach over 1 year ago
Found the bug. Will be fixed in 0.9.7. Thank you so much for reporting that, Etienne!
#7 Updated by Kornelius Kalnbach over 1 year ago
Preliminary fixed version is in the 0.9 stable branch.
#8 Updated by Etienne Massip over 1 year ago
Created a separate issue here : #7329
#9 Updated by Etienne Massip over 1 year ago
This bug is due to r4371 which overrides default Ajax.OnComplete()
#10 Updated by Etienne Massip over 1 year ago
Only possible patch, alas :
1Index: app/views/projects/settings/_members.rhtml 2=================================================================== 3--- app/views/projects/settings/_members.rhtml (revision 4686) 4+++ app/views/projects/settings/_members.rhtml (working copy) 5@@ -57,7 +57,8 @@ 6 <% if roles.any? && principals.any? %> 7 <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post, 8 :loading => "$('member-add-submit').disable()", 9- :complete => "$('member-add-submit').enable()") do |f| %> 10+ :failure => "$('member-add-submit').enable()", 11+ :success => "$('member-add-submit').enable()") do |f| %> 12 <fieldset><legend><%=l(:label_member_new)%></legend> 13 14 <p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
Can't find a way to have both "local" and "global" OnComplete() triggered.
#11 Updated by Jean-Philippe Lang over 1 year ago
Looking at the prototype code, responders do not override those that were previously defined. They should be all called.
The :complete option is used in many places and I don't to make this change unless the problem is clearly found. For example, do you have the same problem when doing a wiki preview?
#12 Updated by Etienne Massip over 1 year ago
Jean-Philippe Lang wrote:
Looking at the prototype code, responders do not override those that were previously defined. They should be all called.
The :complete option is used in many places and I don't to make this change unless the problem is clearly found. For example, do you have the same problem when doing a wiki preview?
I think every other time the :complete option is used is outside of an ajax context.
I've found some posts related to this local override effect, but I didn't look at the code.
#13 Updated by Jean-Philippe Lang over 1 year ago
Etienne Massip wrote:
I think every other time the :complete option is used is outside of an ajax context.
No, the :complete option applies to ajax calls. It's used in link_to_remote most of the time.
#14 Updated by Etienne Massip over 1 year ago
Jean-Philippe Lang wrote:
Looking at the prototype code, responders do not override those that were previously defined. They should be all called.
The :complete option is used in many places and I don't to make this change unless the problem is clearly found. For example, do you have the same problem when doing a wiki preview?
You're right, it should work as wiki preview is working, I will investigate further later.
#15 Updated by Etienne Massip over 1 year ago
Ok, that was stupid, bug is in fact that the "Add" member button does not exist if there is no member to add anymore :
1Index: _members.rhtml 2--- _members.rhtml Base (BASE) 3+++ _members.rhtml Locally Modified (Based On LOCAL) 4@@ -56,8 +56,8 @@ 5 <div class="splitcontentright"> 6 <% if roles.any? && principals.any? %> 7 <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post, 8- :loading => "$('member-add-submit').disable()", 9- :complete => "$('member-add-submit').enable()") do |f| %> 10+ :loading => '$(\'member-add-submit\').disable();', 11+ :complete => 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable();') do |f| %> 12 <fieldset><legend><%=l(:label_member_new)%></legend> 13 14 <p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
#16 Updated by Jean-Philippe Lang over 1 year ago
- Status changed from New to Resolved
- Target version set to 1.1.1
- Resolution set to Fixed
Thanks for providing the fix, it's committed in r4719.
#17 Updated by Jean-Philippe Lang over 1 year ago
- Status changed from Resolved to Closed
Merged in 1.1-stable in r4762.
#18 Updated by Etienne Massip about 1 year ago
- Category set to Project settings