Skip to content

Commit

Permalink
Merge pull request #3 from NelinD/master
Browse files Browse the repository at this point in the history
fix: Баг при копировании виджетов со страницы
  • Loading branch information
butschster authored Jun 26, 2016
2 parents edc24e7 + 26e3796 commit 5199b9b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Manager/WidgetManagerDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ public function copyWidgets($formPageId, $toPageId)
intval($toPageId);
intval($formPageId);

$subSelect = DB::table('page_widgets as pw1')->selectRaw("'$toPageId' as page_id, pw1.widget_id, pw1.block, pw1.position, pw1.set_crumbs")->leftJoin('page_widgets as pw2', function (
$join
) {
return $join->on('pw1.widget_id', '=', 'pw2.widget_id');
})->where('pw1.page_id', $formPageId)->toSQL();
$subSelect = DB::table('page_widgets as pw1')
->selectRaw("'$toPageId' as page_id, pw1.widget_id, pw1.block, pw1.position, pw1.set_crumbs")
->where('pw1.page_id', $formPageId)
->toSQL();

DB::statement("INSERT into page_widgets (page_id, widget_id, block, position, set_crumbs) $subSelect", [
$formPageId,
Expand Down

0 comments on commit 5199b9b

Please sign in to comment.