プロジェクト

全般

プロフィール

Vote #68930

完了

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

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Project settings_43
対象バージョン:
開始日:
2011/01/10
期日:
進捗率:

0%

予定工数:
category_id:
43
version_id:
30
issue_org_id:
7265
author_id:
332
assigned_to_id:
0
comments:
18
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
20
ステータス-->[Closed]

説明

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

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

journals

Can not reproduce with Firefox 3.6.13 or Chrome 8 under Windows.
Do you have javascript error or something that could help?
--------------------------------------------------------------------------------
Got same with FF 4b9.

Here the content of HTTP response to POST request @http://localhost:3000/projects/test1/members/new@ :

<pre>
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",{});
</pre>

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.
--------------------------------------------------------------------------------
And no javascript error or warning in Firebug console.
--------------------------------------------------------------------------------
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.

--------------------------------------------------------------------------------
I'll try to fix this CodeRay bug ASAP.
--------------------------------------------------------------------------------
Found the bug. Will be fixed in 0.9.7. Thank you so much for reporting that, Etienne!
--------------------------------------------------------------------------------
Preliminary fixed version is in the "0.9 stable branch":http://svn.rubychan.de/coderay/branches/0.9/.
--------------------------------------------------------------------------------
Created a separate issue here : #7329
--------------------------------------------------------------------------------
This bug is due to r4371 which overrides default @Ajax.OnComplete()@
--------------------------------------------------------------------------------
Only possible patch, alas :

<pre>
<code class="diff">
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>
</code>
</pre>

Can't find a way to have both "local" and "global" @OnComplete()@ triggered.
--------------------------------------------------------------------------------
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?
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Ok, that was stupid, bug is in fact that the "Add" member button does not exist if there is no member to add anymore :

<pre>
<code class="javascript">
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>
</code>
</pre>

--------------------------------------------------------------------------------
Thanks for providing the fix, it's committed in r4719.
--------------------------------------------------------------------------------
Merged in 1.1-stable in r4762.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリProject settings_43 にセット
  • 対象バージョン1.1.1_30 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0