Project

General

Profile

Actions

Defect #7265

closed

"Loading..." icon does not disappear after add project member

Added by Go MAEDA almost 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Project settings
Target version:
Start date:
2011-01-10
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

"Loading..." icon does not disappear after I have finished to add project member.

  • Firefox 3.6.13 (Mac)
  • Safari 5.0.3 (Mac)

Files

Actions #1

Updated by Jean-Philippe Lang almost 14 years ago

Can not reproduce with Firefox 3.6.13 or Chrome 8 under Windows.
Do you have javascript error or something that could help?

Actions #2

Updated by Etienne Massip almost 14 years 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.

Actions #3

Updated by Etienne Massip almost 14 years ago

And no javascript error or warning in Firebug console.

Actions #4

Updated by Etienne Massip almost 14 years 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.

Actions #5

Updated by Kornelius Kalnbach almost 14 years ago

I'll try to fix this CodeRay bug ASAP.

Actions #6

Updated by Kornelius Kalnbach almost 14 years ago

Found the bug. Will be fixed in 0.9.7. Thank you so much for reporting that, Etienne!

Actions #7

Updated by Kornelius Kalnbach almost 14 years ago

Preliminary fixed version is in the 0.9 stable branch.

Actions #8

Updated by Etienne Massip almost 14 years ago

Created a separate issue here : #7329

Actions #9

Updated by Etienne Massip almost 14 years ago

This bug is due to r4371 which overrides default Ajax.OnComplete()

Actions #10

Updated by Etienne Massip almost 14 years ago

Only possible patch, alas :

Index: app/views/projects/settings/_members.rhtml
===================================================================
--- app/views/projects/settings/_members.rhtml    (revision 4686)
+++ app/views/projects/settings/_members.rhtml    (working copy)
@@ -57,7 +57,8 @@
 <% if roles.any? && principals.any? %>
   <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post,
                                        :loading => "$('member-add-submit').disable()",
-                                       :complete => "$('member-add-submit').enable()") do |f| %>
+                                       :failure => "$('member-add-submit').enable()",
+                                       :success => "$('member-add-submit').enable()") do |f| %>
     <fieldset><legend><%=l(:label_member_new)%></legend>

         <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.

Actions #11

Updated by Jean-Philippe Lang almost 14 years 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?

Actions #12

Updated by Etienne Massip almost 14 years 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.

Actions #13

Updated by Jean-Philippe Lang almost 14 years 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.

Actions #14

Updated by Etienne Massip almost 14 years 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.

Actions #15

Updated by Etienne Massip almost 14 years 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 :

Index: _members.rhtml
--- _members.rhtml Base (BASE)
+++ _members.rhtml Locally Modified (Based On LOCAL)
@@ -56,8 +56,8 @@
 <div class="splitcontentright">
 <% if roles.any? && principals.any? %>
   <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post,
-                                       :loading => "$('member-add-submit').disable()",
-                                       :complete => "$('member-add-submit').enable()") do |f| %>
+                                       :loading => '$(\'member-add-submit\').disable();',
+                                       :complete => 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable();') do |f| %>
     <fieldset><legend><%=l(:label_member_new)%></legend>

         <p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>

Actions #16

Updated by Jean-Philippe Lang almost 14 years 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.

Actions #17

Updated by Jean-Philippe Lang almost 14 years ago

  • Status changed from Resolved to Closed

Merged in 1.1-stable in r4762.

Actions #18

Updated by Etienne Massip over 13 years ago

  • Category set to Project settings
Actions

Also available in: Atom PDF