Bug fix
Permalink Browser Info Environment
I really like the add-on, it's very simple and looks great. However, I noticed that sometimes the block was mysteriously deleting all of it's data, specifically when I changed the padding or margin of the block using custom css in the design menu. I looked in the controller and it seems the bug is caused by the empty duplicate method. When you change certain properties of a block, concrete actually makes a duplicate copy of the block, so that earlier page versions can display the older block. When the duplicate method, the new block ends up without any data. Here is code for the duplicate method that fixes the bug:
Thanks for the great block!
function duplicate($nbID) { parent::duplicate($nbID); $this->getItems(); $db = Loader::db(); foreach($this->items as $i) { $db->Execute('insert into btWhaleNivoSliderItems (`bID`, `fID`, `itemTitle`, `itemDesc`, `itemUrl`, `position`) VALUES (?,?,?,?,?,?)', array($nbID, $i['fID'], $i['itemTitle'], $i['itemDesc'], $i['itemURL'], $i['position']) ); } }
Thanks for the great block!
Type: | Discussion |
---|---|
Status: | New |