Skip to content

Commit

Permalink
Fixed bug in stop element creation with ptable
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Jun 10, 2015
1 parent 4e1126e commit ce0715a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MadeYourDay/Contao/Columns.php
Expand Up @@ -97,13 +97,16 @@ public function onsubmitCallback($dc)
SELECT type
FROM tl_content
WHERE pid = ?
AND (ptable = ? OR ptable = ?)
AND type IN (\'rs_column_start\', \'rs_column_stop\', \'rs_columns_start\', \'rs_columns_stop\')
AND sorting > ?
ORDER BY sorting ASC
LIMIT 1
')
->execute(
$activeRecord->pid,
$activeRecord->ptable ?: 'tl_article',
$activeRecord->ptable === 'tl_article' ? '' : $activeRecord->ptable,
$activeRecord->sorting
);

Expand All @@ -119,6 +122,7 @@ public function onsubmitCallback($dc)
->prepare('INSERT INTO tl_content %s')
->set(array(
'pid' => $activeRecord->pid,
'ptable' => $activeRecord->ptable ?: 'tl_article',
'type' => substr($activeRecord->type, 0, -5) . 'stop',
'sorting' => $activeRecord->sorting + 1,
'tstamp' => time(),
Expand Down

0 comments on commit ce0715a

Please sign in to comment.