Permalink
Browse files

Variable CSV delimiter (see #3635 and #2890)

  • Loading branch information...
1 parent 8b9f71e commit f0e649d51849a50b9d1a998aaf94e9aa26dfccd6 @leofeyer leofeyer committed Jan 5, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 system/drivers/DC_Table.php
@@ -1702,9 +1702,9 @@ public function edit($intID=null, $ajaxId=null)
}
// Convert CSV fields (see #2890)
- if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['multiple'] && $GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['csv'])
+ if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['multiple'] && isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['csv']))
{
- $this->varValue = trimsplit(',', $this->varValue);
+ $this->varValue = trimsplit($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['csv'], $this->varValue);
}
// Call load_callback
@@ -2592,9 +2592,9 @@ protected function save($varValue)
{
$varValue = '';
}
- elseif ($arrData['eval']['csv'])
+ elseif (isset($arrData['eval']['csv']))
{
- $varValue = implode(',', $varValue); // see #2890
+ $varValue = implode($arrData['eval']['csv'], $varValue); // see #2890
}
else
{
@@ -2604,9 +2604,9 @@ protected function save($varValue)
}
// Convert arrays (see #2890)
- if ($arrData['eval']['multiple'] && $arrData['eval']['csv'])
+ if ($arrData['eval']['multiple'] && isset($arrData['eval']['csv']))
{
- $varValue = implode(',', deserialize($varValue, true));
+ $varValue = implode($arrData['eval']['csv'], deserialize($varValue, true));
}
// Trigger the save_callback
@@ -4521,7 +4521,7 @@ protected function filterMenu()
elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['multiple'])
{
// CSV lists (see #2890)
- if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['csv'])
+ if (isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['csv']))
{
$this->procedure[] = $this->Database->findInSet('?', $field, true);
$this->values[] = $session['filter'][$filter][$field];
@@ -4648,9 +4648,9 @@ protected function filterMenu()
foreach($options as $option)
{
// CSV lists (see #2890)
- if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['csv'])
+ if (isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['csv']))
{
- $doptions = trimsplit(',', $option);
+ $doptions = trimsplit($GLOBALS['TL_DCA'][$this->strTable]['fields'][$field]['eval']['csv'], $option);
}
else
{

3 comments on commit f0e649d

This isn't backwards compatible, is it? How about adding something like if ($GLOBALS[…]['csv'] === true) $GLOBALS[…]['csv'] = ',';?

Member

Toflar replied Jan 9, 2012

It has been added in 2.11 only (#2890) so it's not a feature of a previous stable version that has to be backward compatible ;)

Yeah, that's true ;-). Didn't see that.

Please sign in to comment.