CC-4572: Adding a playlist to a show in Now Playing page fails, interface greys out
- bug with php 5.3.2 with DateTime::createFromFormat() - fixed with workaround
This commit is contained in:
parent
562c509939
commit
3f1df49221
5 changed files with 71 additions and 21 deletions
|
@ -5,7 +5,7 @@
|
|||
/**
|
||||
* Skeleton subclass for representing a row from the 'cc_blockcontents' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
|
@ -44,11 +44,16 @@ class CcBlockcontents extends BaseCcBlockcontents {
|
|||
*/
|
||||
public function setDbFadein($v)
|
||||
{
|
||||
$microsecond = 0;
|
||||
if ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
}
|
||||
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
||||
$dt = DateTime::createFromFormat("s.u", $v);
|
||||
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
|
||||
// Hence we need to do parsing.
|
||||
$info = explode('.', $v);
|
||||
$microsecond = $info[1];
|
||||
$dt = DateTime::createFromFormat("s", $info[0]);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -58,7 +63,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
|
|||
}
|
||||
}
|
||||
|
||||
$this->fadein = $dt->format('H:i:s.u');
|
||||
$this->fadein = $dt->format('H:i:s').".".$microsecond;
|
||||
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN;
|
||||
|
||||
return $this;
|
||||
|
@ -72,11 +77,16 @@ class CcBlockcontents extends BaseCcBlockcontents {
|
|||
*/
|
||||
public function setDbFadeout($v)
|
||||
{
|
||||
$microsecond = 0;
|
||||
if ($v instanceof DateTime) {
|
||||
$dt = $v;
|
||||
}
|
||||
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
|
||||
$dt = DateTime::createFromFormat("s.u", $v);
|
||||
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
|
||||
// Hence we need to do parsing.
|
||||
$info = explode('.', $v);
|
||||
$microsecond = $info[1];
|
||||
$dt = DateTime::createFromFormat("s", $info[0]);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -86,7 +96,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
|
|||
}
|
||||
}
|
||||
|
||||
$this->fadeout = $dt->format('H:i:s.u');
|
||||
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
|
||||
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT;
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue