ericpaulbishop / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
186 stars 37 forks source link

Broken in Redmine trunk #126

Open ghost opened 12 years ago

ghost commented 12 years ago

This plugin is semi broken in Redmine trunk. I'm using revision 8032, and the checkout url box, displays absolutely no urls on the repositories page (seems fine on the overview page though).

I haven't determined how much is broken as of yet, but that's the first thing I noticed. It looks relatively cosmetic, which is good at least.

I don't see any javascript errors to report back to you, so that does make it a little harder to track down..

Edit 2: I've made some regular commits, and I haven't seen any errors or problems in any other functionality yet.

mercury00 commented 12 years ago

I was wondering about that, I thought there was supposed to be something there but wasn't sure if I had done something wrong.

I'm sure this is mostly cosmetic, but it would be nice to have working. Any info we can provide to make it easy? Or any hints on where to look in the code to see if we can fix it ourselves?

I don't know if this is what you're talking about, but I noticed I needed to symlink /var/cache/redmine/default/plugin_assets into the /usr/share/redmine/public folder (plugin_assets in that folder). A bunch of stuff was in the var/cache folder and nothing was in the redmine public/plugin_assets folder, and after I symlinked it many errors stopped filling the production log, and lots of things started working.
kubitron commented 12 years ago

This is a bug in code that was added to redmine version 1.2.2. I've already submitted a fix (and it will appear in 1.3.1). If you want to patch early, it is in app/views/repositories/_revision_graph.html.erb.

The bug is setting window.onload directly rather than using the proper prototype Event.observe() pattern.

diff --git a/app/views/repositories/_revision_graph.html.erb b/app/views/repositories/_revision_graph.html.erb
index 02e26de..8a0a6a0 100644
--- a/app/views/repositories/_revision_graph.html.erb
+++ b/app/views/repositories/_revision_graph.html.erb
@@ -5,9 +5,9 @@
 <%= javascript_include_tag "revision_graph.js" %>

 <script type="text/javascript">
-  window.onload = function(){
+  Event.observe(window,"load",function(){
     branchGraph(document.getElementById("holder"));
-  }
+  });
 </script>

 <div id="holder" class="graph"></div>

Note that this is also a bug in the plugin javascript that puts up the box (i.e. it will mess with redmine plugins). I have a patch that will be added to my next patch on my branch: https://github.com/kubitron/redmien_git_hosting.

ghost commented 12 years ago

@kubitron Thanks for letting us know! I've updated my svn copy, that fix was included, and I can verify that things are working again. :) I suppose this issue is no longer valid now..

kubitron commented 12 years ago

Actually, the same issue exists in the plugin file: redmine_git_hosting/app/views/repositories/_git_urls.erb.

Change:

Window.onload = setGitUrlOnload

To:

Event.observe(window,"load",setGitUrlOnLoad)

As it is, the redmine_git_hosting plugin will mess with anything loaded before the URL display code on a page.

ghost commented 12 years ago

Confirmed. The same issue also exists in plugin file: redmine_git_hosting/app/views/projects/_git_urls.erb

kubitron commented 12 years ago

I've fixed these issues (and a bunch of others) in my master branch. Please given them a try:

https://github.com/kubitron/redmine_git_hosting

sduensin commented 12 years ago

Just found this myself. @kubitron, you're a madman. Thanks for your continued efforts!

kubitron commented 12 years ago

I'll assume that this is a good thing :-).