Duplicate Blocks are showing up (from page type default)

Permalink 1 user found helpful
Not sure if I should have put this in the bugs section as I might be doing something wrong....Each time I go into the default page type and edit a block (i.e. change a link the footer) and click on "Setup on Child Pages", the child pages that it sets them up on adds another block instead of replacing what's there. "Duplicate" may have been the wrong word as it adds the newest version of the block but also keeps the old one. I'm wondering if maybe it's an issue with the deleteBlock() method as every once in a while I get a fatal error saying "call to a member function deleteBlock on a non-object" (or something like that). Anyone had this happen before?

overthemike
 
overthemike replied on at Permalink Reply
overthemike
bump...
tbcrowe replied on at Permalink Reply
tbcrowe
I had a similar problem when I set up a site a while back. I was getting blocks appearing and not appearing when I didn't want them to. I don't recall the specifics now, but I was not seeing the "call to member..." error. I was lucky, though, because the site was very preliminary and I decided to just wipe the DB and start over.

My advice is to see if you can duplicate the problem consistently, especially the error message, and then post the steps required to repeat it.
overthemike replied on at Permalink Reply
overthemike
The error message isn't consistent, but I have been able to duplicate it. The first time it happened I believe I unselected all of the blocks and updated it, got the fatal error. The second time I tried to do it to just one block (learned my lesson after going through each page and having to delete the duplicate blocks).

However as far as the blocks being duplicated, it happens every time. I thought it may have been that the CMS was pushing the block to all the child pages as if it were a new block as opposed to updating, but if that's the case, how would you update that block across all pages? So I don't necessarily think that's the case...
tbcrowe replied on at Permalink Reply
tbcrowe
Actually, I think that's all it is doing: duplicating it. The way around this is use block aliases instead of copying them. What I have done is create the original block temporarily on a page, copy it into the global scrapbook as an alias, delete the original, then apply the alias in the scrapbook to page template. Then when you modify the block it will update on all of the pages.

I didn't go through this again to make sure that's exactly how I've done it and this isn't something I have done a lot, so keep that in mind. Also, I admit I haven't looked into to this particular code to see what it's doing. There may be an easier way to do this as well.
overthemike replied on at Permalink Reply
overthemike
Actually I think that's exactly what I was doing - although I'm not sure. What I did was create the block first on the main index page (using a different template than the rest of the pages on the site). I then copied to the scrapbook and went to the page type defaults and copied it from the scrapbook to the defaults page. After that, I clicked on "Setup on Child Pages" for the copied block (in this case the footer). It set them up just fine. The issue is when I went to update it on the default page type, it pushes the block out to all the child pages a second time, keeping the first one I pushed and adding the second one. The default page looks just fine, it's the child pages that have the extra block.
karenalenore replied on at Permalink Reply
karenalenore
Ok here's the error!

Fatal error: Call to a member function deleteBlock() on a non-object in C:\Documents and Settings\Karena Kreger\My Documents\Projects\A Perfect Bounce\Website\root\concrete5.3.3.1\concrete\startup\process.php on line 160

Basically i cannot get a consistent usage of the scrapbook with the page type defaults. Sometimes things work and update properly. Sometimes not.
overthemike replied on at Permalink Reply
overthemike
It's been a little while since I had this issue, but I'm wondering if the update issue is maybe because I was using the admin scrapbook as opposed to the global one. Does this ring a bell by chance?
WebStudioEast replied on at Permalink Reply
I am also receiving this error. Has anyone reported this as a bug? What can I do to help get it fixed?
billabong replied on at Permalink Reply
billabong
I´m also having the same problem. But I never received any error message.
I don´t hope that´s the way it is supposed to be.
So how can a block on the defaults page be removed or edited and updated without having manually remove all the duplicates from all the child pages?
billabong replied on at Permalink Reply
billabong
I´m also having the same problem. But I never received any error message.
I don´t hope that´s the way it is supposed to be.
So how can a block on the defaults page be removed or edited and updated without having manually remove all the duplicates from all the child pages?
WebStudioEast replied on at Permalink Reply
If you're not getting an error then you might just be in a situation where the blocks on the pages are no longer the same as the one on the default page.

Lets say you have a "contact info" block on the default page and then you setup that block on all the child pages. Then, you go to the "about us" page and edit the "contact info" block from that page. That "contact info" block will become it's own unique block separate from the one on the default page.

So if you then go to the default page and setup the "contact info" block to all pages again you will end up with two "contact info" blocks on the "about us" page. One from the defaults and the other a duplicate because it became unique when you edited it.

Hot sure if that is the problem you're having but hopefully it'll help you or someone else.
netnerd85 replied on at Permalink Reply
Thanks to tbcrowe's reply I was able to add a global block. I can confirm with what he said to do, first create a temporary page, setup a block on it, copy it to the scrapbook as an alias. Then add the block to the page type defaults by pasting from scrap book. Now you can update the block on any page you want and it will be affected. You can delete the temp page as well. This is the only way I have been able to find a truly global block.

Also to stop duplicates you can remove the block from all sub-pages first using the steps outlined on this topic:http://www.concrete5.org/community/forums/usage/deletion_of_block_f...