| @@ -47,11 +47,8 @@ | ||
| 47 | 47 | * @param mixed $srcBackupId |
| 48 | 48 | * @param mixed $desBackupId |
| 49 | 49 | */ |
| 50 | 50 | public function copyBackupBlocks($srcBackupId, $desBackupId) { |
| 51 | - // Initialie. | |
| 52 | - $codeFilesQuery = 'INSERT INTO #__cjtoolbox_block_files (blockId, id, name, description, `type`, code, `order`) | |
| 53 | - SELECT %d, id, name, description, `type`, code, `order` FROM #__cjtoolbox_block_files WHERE blockId = %d;'; | |
| 54 | 51 | // Blocks Table & Model.. |
| 55 | 52 | require_once CJTOOLBOX_TABLES_PATH . '/blocks.php'; |
| 56 | 53 | require_once CJTOOLBOX_TABLES_PATH . '/block-pins.php'; |
| 57 | 54 | require_once CJTOOLBOX_MODELS_PATH . '/blocks.php'; |
| @@ -100,10 +97,8 @@ | ||
| 100 | 97 | $blocksTable->insert($blockData); |
| 101 | 98 | // Insert block Pins. |
| 102 | 99 | $pinsData = array_intersect_key($block, array_flip(array('pages', 'posts', 'categories'))); |
| 103 | 100 | $blockPinsTable->insert($block['id'], $pinsData); |
| 104 | - // Copy code files. | |
| 105 | - $this->dbDriver->insert(sprintf($codeFilesQuery, $block['id'], $id))->processQueue(); | |
| 106 | 101 | } |
| 107 | 102 | } |
| 108 | 103 | |
| 109 | 104 | /** |
| @@ -170,10 +165,8 @@ | ||
| 170 | 165 | $blocks = $blocksTable->get(null, $blocks['fields'], $blocks['filters']); |
| 171 | 166 | // Delete blocks using its Id. |
| 172 | 167 | $ids = array_keys($blocks); |
| 173 | 168 | $blocksModel->delete($ids); |
| 174 | - // Delete code files. | |
| 175 | - $this->dbDriver->delete('DELETE FROM #__cjtoolbox_block_files where blockId IN (' . implode(',', $ids) . ');'); | |
| 176 | 169 | // In order for $this->processQueue to work |
| 177 | 170 | // we need to Merge db driver queues into the current |
| 178 | 171 | // local queue. |
| 179 | 172 | $this->dbDriver->merge($blocksModel->dbDriver()); |