# Can't add page part with Shards installed?

**URL:** <https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468>\
**Category:** Radiant CMS\
**Created:** [November 7, 2007, 8:17am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468 "2007-11-07T08:17:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 8:17am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/1 "2007-11-07T08:17:45Z")

</div>

Hi, guys.

I am currently trying out Radiant, and I have the intention of writing  
an admin extension to it. It seems to me that this is easier/better  
using the Shards extension, so I used Piston to import shards (from  
the trunk, revision 571, which seems to be the latest) to  
vendor/extensions/shards.

I also have Radiant imported from the trunk (revision 575), using  
Piston, to vendor/radiant.

I am not using any other extensions, and even so I made sure, on  
environment.rb, that shards was loaded before anything else.

Now, when I try to add a page part to a page, what happens is the  
following:

1. I click on the green plus sign on the far right
2. The little window pops up, and I write the name of my page part
3. FireBug reports an error (the console output is here:  
[Parked at Loopia](http://pastie.caboo.se/114928))
4. Radiant goes to /admin/ui/pages/part/add, where it renders  
“admin/page/\_part”, with no layout. The log can be seen here:  
[Parked at Loopia](http://pastie.caboo.se/114925)
5. Upon going back to the admin interface, no page parts were added.

Does anyone have a clue on why this is happening?

Thanks,  
Marcelo A…

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 8:21am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/2 "2007-11-07T08:21:51Z")

</div>

Marcelo A. wrote:

> [Parked at Loopia](http://pastie.caboo.se/114925)  
> 5) Upon going back to the admin interface, no page parts were added.
> 
> Does anyone have a clue on why this is happening?
> 
> Thanks,  
> Marcelo A…

Hi Marcelo

I had the exact same problem without Shards on Rev 573. It seemed to be  
fixed in Rev 575 of Radiant. Can you verify that it works fine without  
Shards?

Also, are you using copy\_move extension? The archive previously on the  
site (if you didn’t get it by darcs) was a bit outdated and _may_ have  
had something to do with it.

Cheers,  
Mohit.  
11/7/2007 | 3:20 PM.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 8:23am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/3 "2007-11-07T08:23:01Z")

</div>

Marcelo A. wrote:

> [Parked at Loopia](http://pastie.caboo.se/114925)  
> 5) Upon going back to the admin interface, no page parts were added.
> 
> Does anyone have a clue on why this is happening?
> 
> Thanks,  
> Marcelo A…

Sorry, I just noticed that you say that you are not using any other  
extensions. Can you confirm that it works fine without Shards?

Cheers,  
Mohit.  
11/7/2007 | 3:21 PM.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 3:50pm UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/4 "2007-11-07T15:50:23Z")

</div>

Sorry for the issues. I updated the core yesterday with Mislav’s JS  
patch but did not get Shards updated. I will do so today.

Sean

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 1:31pm UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/5 "2007-11-07T13:31:31Z")

</div>

Hi!

Thanks for your quick response. I did some “researching” here, and  
just found out that with my setup (Radiant gem 0.6.3, Ruby 1.8.6 on a  
Windows XP machine), if I do a regular “radiant site”, then “rake  
radiant:freeze:edge” (goes to revision 580), I get a weird thing when  
editing a page: all the parts’ tabs are duplicated! You can see it  
here: [http://marceloalvim.com/double\_parts.jpg](http://marceloalvim.com/double_parts.jpg). Oh, I also ran rake  
radiant:update and rake radiant:update:javascripts. I’m not sure when  
I should use those, but I thought it would be better do it than not.

The “Blog” title was edited by me, but other than that, this came from  
a regular db:bootstrap. I checked the database, and it had no  
duplicated parts associated with the same page.

So I tested it again, cleaning the database and checking out radiant  
from revision 575 of the trunk. Again, rake radiant:update and rake  
radiant:update:javascripts. No duplicated parts, and I was able to add  
and remove parts perfectly. Next step with this setup: installing  
Shards. I checked out shards from the latest revision of trunk, and  
voilá, the behavior I told you in the first email: upon creating a  
part, the error in javascript (as caught by firebug) and the rendering  
of the partial with no layout. Whew!

Now, for the last test of all (just to be sure), I tested radiant edge  
WITH shards! 🙂  
Result: TRIPLE page part tabs, PLUS the error when adding one. Ok,  
this one was just not fair. 😉

So, does anyone have any idea of why might that be happening? Does it  
happen to someone else? Am I doing something wrong?

Thanks,  
Marcelo.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/6 "2007-11-07T22:30:00Z")

</div>

Hi, Sean.

Thanks for all your hard work, I appreciate it. What I found  
particularly weird is that I had these issues with Radiant edge even  
without Shards. The “double tabs” problem was very strange. I will  
also try to look into it, but I’m not sure I’ll be able to help much.  
I’ll talk to you guys later today.

Thanks!  
Marcelo.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 8, 2007, 12:16am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/7 "2007-11-08T00:16:05Z")

</div>

The “double tabs” issue was a result of a botched patch on my part. The  
contents of admin.js were duplicated. Removal of the extra lines  
removed the issue.

Sean

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 7, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/8 "2007-11-07T18:00:30Z")

</div>

Marcelo A. wrote:

> 

_snip_

Hi Marcelo,

It seems from Sean’s email that the problems should be fixed (already or  
soon). Hopefully, it works. I’m not using shard, so can’t comment on  
it. I just got involved cos I had a very similar problem just  
yesterday!

Cheers,  
Mohit.  
11/8/2007 | 12:59 AM.

---

<div class="post-metadata">

**Author:** ![marcelo\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@marcelo\_a](https://www.ruby-forum.com/u/marcelo_a)\
**Post date:** [November 8, 2007, 3:21am UTC](https://www.ruby-forum.com/t/cant-add-page-part-with-shards-installed/119468/9 "2007-11-08T03:21:19Z")

</div>

Oh, alright.

I just tested it with the latest trunk revision of both Shards and  
Radiant, and it all worked perfectly.

Thank you very much, Sean!

Marcelo.
