# Shards and admin\_tree\_structure

**URL:** <https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178>\
**Category:** Radiant CMS\
**Created:** [November 14, 2007, 3:14pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178 "2007-11-14T15:14:39Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 14, 2007, 3:14pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/1 "2007-11-14T15:14:39Z")

</div>

Hi,

I upgraded my radiant installation from admin\_parts to shards yesterday,  
and  
it works like a charm.  
Today, I wanted to give admin\_tree\_structure a try because I’m begining  
to  
get a bit too much posts on my blog 0:-)  
It kinda works, but the “comments” column added by the comments  
extension on  
the pages listing is empty now (what a surprise, as both override  
\_node.rhtml) but I can live without it.  
Now, there’s something strange with the tree expansion, if I expand and  
collapse something, I can’t reexpand it, and from time to time, I can’t  
even  
collapse something I’ve expanded.  
Any idea ?

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 12:22am UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/2 "2007-11-15T00:22:06Z")

</div>

> Today, I wanted to give admin\_tree\_structure a try because I’m begining to  
> get a bit too much posts on my blog 0:-)  
> It kinda works, but the “comments” column added by the comments extension on  
> the pages listing is empty now (what a surprise, as both override  
> \_node.rhtml) but I can live without it.  
> Now, there’s something strange with the tree expansion, if I expand and  
> collapse something, I can’t reexpand it, and from time to time, I can’t even  
> collapse something I’ve expanded.  
> Any idea ?

I’m guessing it’s because of the javascript changes in shards and  
core. I haven’t made changes to admin\_tree\_structure since then, so  
it’s probably broken. I’ll have a look-see.

We really need to get some browser-based testing (selenium maybe?), as  
javascript bugs seem to be a fair proportion of the problems these  
days.

Dan.

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 7:15am UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/3 "2007-11-15T07:15:47Z")

</div>

> I upgraded my radiant installation from admin\_parts to shards  
> yesterday, and  
> it works like a charm.  
> Today, I wanted to give admin\_tree\_structure a try because

Have just updated admin\_tree\_structure to work with the latest core +  
shards.

[http://soxbox.no-ip.org/radiant/svn/extensions/admin\_tree\_structure](http://soxbox.no-ip.org/radiant/svn/extensions/admin_tree_structure)

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/4 "2007-11-15T14:12:25Z")

</div>

Make sure to load Shards first. In your environment.rb:

# Define extension load order

config.extensions = [:shards, :all]

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 9:24am UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/5 "2007-11-15T09:24:33Z")

</div>

±Le 15/11/07 17:08 +1100, Daniel S. a dit :  
|\> I upgraded my radiant installation from admin\_parts to shards  
|\> yesterday, and  
|\> it works like a charm.  
|\> Today, I wanted to give admin\_tree\_structure a try because  
|  
| Have just updated admin\_tree\_structure to work with the latest core +  
| shards.  
|  
| [http://soxbox.no-ip.org/radiant/svn/extensions/admin\_tree\_structure](http://soxbox.no-ip.org/radiant/svn/extensions/admin_tree_structure)

I hate to say that it does not change much. I do have the comments  
column  
that’s back, but only on the pages that are on the first level, plus,  
the  
little + does not change into a - when expanded :  
[http://mat.cc/distfiles/admin\_tree\_strangeness.pdf](http://mat.cc/distfiles/admin_tree_strangeness.pdf)  
(Does the same in FireFox and in Safari, both with cleared cache.)

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 3:32pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/6 "2007-11-15T15:32:19Z")

</div>

Try refreshing your browser once the three is expanded. This works  
for me at least.

I do not know why the comments column does not show up when pushing  
(+), but think Daniel, John or Sean said it had something to do with  
the sitemap javascript.

Greetings

Hans-Christian Fjeldberg  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/7 "2007-11-15T15:50:30Z")

</div>

Ignore my last post!!!

I have the same problems as you describe it seems. Without the  
admin\_tree\_structure extension, only the comments extension.

Greetings

Hans-Christian Fjeldberg  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 2:50pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/8 "2007-11-15T14:50:32Z")

</div>

±le 15.11.2007 07:11:21 -0600, Ryan H. a dit :  
| Make sure to load Shards first. In your environment.rb:  
|  
| # Define extension load order  
| config.extensions = [:shards, :all]

That’s already the case.

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/9 "2007-11-15T16:48:42Z")

</div>

Sorry…

Even onMouseClickRow is called two times when pushing the plus (+) sign.

Greetings

Hans-Christian Fjeldberg  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 4:35pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/10 "2007-11-15T16:35:50Z")

</div>

I haven’t figured out the answer to the problem, but more  
specifically the problem seems to be that toggleExpanded in  
SiteMap.js is called two times (using FireBug).

I haven’t figured out why or from where it is called two times.

Greetings

Hans-Christian Fjeldberg  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/11 "2007-11-15T19:21:16Z")

</div>

Daniel S. wrote:

> We really need to get some browser-based testing (selenium maybe?), as  
> javascript bugs seem to be a fair proportion of the problems these  
> days.

I second.

I’ve been looking at the selenium\_on\_rails plugin to add testing for an  
extension that I’m working on. I’d love to see not only radiant using  
selenium but to have it integrate with extensions (after all, they’re  
the source of much of the breakage).

Writing good tests might get sticky in certain cases where extension A  
overrides extension B or Radiant, though.

-Chris

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 11:11pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/12 "2007-11-15T23:11:55Z")

</div>

> I’ve been looking at the selenium\_on\_rails plugin to add  
> testing for an  
> extension that I’m working on. I’d love to see not only  
> radiant using  
> selenium but to have it integrate with extensions (after all, they’re  
> the source of much of the breakage).
> 
> Writing good tests might get sticky in certain cases where  
> extension A  
> overrides extension B or Radiant, though.

Hence this:

[http://soxbox.no-ip.org/radiant/svn/extensions/test\_filtering/](http://soxbox.no-ip.org/radiant/svn/extensions/test_filtering/)

Which allows your extensions to declare which tests they’re breaking on  
purpose.

I live for a clean rake test && rake test:extensions

Dan.

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/13 "2007-11-15T23:09:35Z")

</div>

> | [http://soxbox.no-ip.org/radiant/svn/extensions/admin\_tree\_structure](http://soxbox.no-ip.org/radiant/svn/extensions/admin_tree_structure)
> 
> I hate to say that it does not change much. I do have the  
> comments column  
> that’s back, but only on the pages that are on the first  
> level, plus, the  
> little + does not change into a - when expanded :  
> [http://mat.cc/distfiles/admin\_tree\_strangeness.pdf](http://mat.cc/distfiles/admin_tree_strangeness.pdf)  
> (Does the same in FireFox and in Safari, both with cleared cache.)

Since Hans mentioned that he’s getting this problem with only the  
comments extension installed, I’m guessing the source of the  
problem is there.

Do the tests on admin\_tree\_structure still pass? (rake test:extensions  
EXT=admin\_tree\_structure)

Dan.

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 15, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/14 "2007-11-15T23:38:54Z")

</div>

±Le 16/11/07 09:01 +1100, Daniel S. a dit :  
|  
|\> ±Le 15/11/07 17:08 +1100, Daniel S. a dit :  
|\> |\> I upgraded my radiant installation from admin\_parts to shards  
|\> |\> yesterday, and  
|\> |\> it works like a charm.  
|\> |\> Today, I wanted to give admin\_tree\_structure a try because  
|\> |  
|\> | Have just updated admin\_tree\_structure to work with the  
|\> latest core +  
|\> | shards.  
|\> |  
|\> | [http://soxbox.no-ip.org/radiant/svn/extensions/admin\_tree\_structure](http://soxbox.no-ip.org/radiant/svn/extensions/admin_tree_structure)  
|\>  
|\> I hate to say that it does not change much. I do have the  
|\> comments column  
|\> that’s back, but only on the pages that are on the first  
|\> level, plus, the  
|\> little + does not change into a - when expanded :  
|\> [http://mat.cc/distfiles/admin\_tree\_strangeness.pdf](http://mat.cc/distfiles/admin_tree_strangeness.pdf)  
|\> (Does the same in FireFox and in Safari, both with cleared cache.)  
|  
| Since Hans mentioned that he’s getting this problem with only the  
| comments extension installed, I’m guessing the source of the problem is  
| there.  
|  
| Do the tests on admin\_tree\_structure still pass? (rake test:extensions  
| EXT=admin\_tree\_structure)

$ rake test:extensions EXT=admin\_tree\_structure  
(in /usr/home/mat/web)  
(in /usr/home/mat/web/vendor/extensions/admin\_tree\_structure)  
/usr/local/bin/ruby18 -Ilib:lib  
“/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake\_test\_loader.rb”  
“test/functional/admin\_tree\_structure\_extension\_test.rb”  
/usr/home/mat/web/config/…/config/environment.rb:4: warning: already  
initialized constant RADIANT\_GEM\_VERSION  
Loaded suite  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake\_test\_loader  
Started  
…  
Finished in 25.284529 seconds.

5 tests, 158 assertions, 0 failures, 0 errors

I think it does.

---

<div class="post-metadata">

**Author:** ![Mathieu\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathieu\_A](https://www.ruby-forum.com/u/Mathieu_A)\
**Post date:** [November 17, 2007, 1:46am UTC](https://www.ruby-forum.com/t/shards-and-admin-tree-structure/120178/15 "2007-11-17T01:46:57Z")

</div>

±Le 15/11/07 16:47 +0100, Hans-Christian Fjeldberg a dit :  
| Sorry…  
|  
| Even onMouseClickRow is called two times when pushing the plus (+) sign.

Looks like shards:r604 fixed all the rendering problem I had.
