| @@ -80,11 +80,12 @@ | ||
| 80 | 80 | if (count($revisions) == self::MAX_REVISIONS_PER_BLOCK) { |
| 81 | 81 | $this->delete(array_shift($revisions)->id); |
| 82 | 82 | } |
| 83 | 83 | // Get block data. |
| 84 | - $block['fields'] = array('lastModified', 'pinPoint', 'code', 'links', 'expressions'); | |
| 84 | + $block['fields'] = array('id', 'lastModified', 'pinPoint', 'code', 'links', 'expressions'); | |
| 85 | 85 | // get() developed to return multiple blocks, fetch the first. |
| 86 | - $block = array_shift($blocks->get($blockId, $block['fields'])); | |
| 86 | + $result = $blocks->get($blockId, $block['fields']); | |
| 87 | + $block = reset($result); | |
| 87 | 88 | // Set other fields. |
| 88 | 89 | $block->location = $block->state = ''; |
| 89 | 90 | $block->parent = $blockId; |
| 90 | 91 | $block->type = 'revision'; |