Skip to content

Commit 91277df

Browse files
committed
Do not override a potentially existing pid or sorting entry in edit multiple mode
1 parent 8fc3995 commit 91277df

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

system/modules/core/drivers/DC_Table.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -2192,8 +2192,22 @@ public function editAll($intId=null, $ajaxId=null)
21922192
array_unshift($this->strPalette, 'pid');
21932193
}
21942194

2195-
$GLOBALS['TL_DCA'][$this->strTable]['fields']['pid'] = array('label'=>&$GLOBALS['TL_LANG']['MSC']['pid'], 'inputType'=>'text', 'eval'=>array('rgxp'=>'natural'));
2196-
$GLOBALS['TL_DCA'][$this->strTable]['fields']['sorting'] = array('label'=>&$GLOBALS['TL_LANG']['MSC']['sorting'], 'inputType'=>'text', 'eval'=>array('rgxp'=>'natural'));
2195+
// Ensure a minimum configuration
2196+
foreach (array('pid', 'sorting') as $f)
2197+
{
2198+
if (!isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['label']))
2199+
{
2200+
$GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['label'] = &$GLOBALS['TL_LANG']['MSC'][$f];
2201+
}
2202+
if (!isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['inputType']))
2203+
{
2204+
$GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['inputType'] = 'text';
2205+
}
2206+
if (!isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['eval']))
2207+
{
2208+
$GLOBALS['TL_DCA'][$this->strTable]['fields'][$f]['eval'] = array('rgxp' => 'natural');
2209+
}
2210+
}
21972211
}
21982212

21992213
// Begin current row

0 commit comments

Comments
 (0)