Block Design and Loosing Data

Permalink
I'm running across a weird little Block Design bug causing table data loss issues.

I have a block with two tables, the first is named correctly according to the Block/Table naming specs. Then there is a second table with a one-to-many relationship to the first table.

* If a user edits the page, then edits the block, everything goes well.

* If a user edits the page, then edits the block, then edits the 'Design' everything works well.

* If a user edits the page, then edits the 'Design' of the block, the data in the associated table isn't copied to reflect the new bID.

It doesn't seem that the 'Save' method in the block is being triggered if the user only edits the 'Design' of the block and not the block itself. (I have functionality in the 'Save' method to update the associated table.)

What am I missing? Is this a bug, a feature, or something else?

Thanks for your help.

SkyBlueSofa
 
SkyBlueSofa replied on at Permalink Reply
SkyBlueSofa
After digging around in the documentation and code, I ran across the 'Duplicate' method in the Block Controller. It looks like this is run before a block is edited or 'designed'. I've added some code to duplicate the rows in the associated table.

Hopefully this will work, but will have to wait to test it out. I will post the results.
jordanlev replied on at Permalink Reply
jordanlev
Yes, this is what you need to do. Took me a while to discover that as well. Wish there were better documentation about this stuff :-/