diff --git a/.travis.yml b/.travis.yml index 3a7a2d7378e..6da8aa1681b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,7 @@ env: # Aim to run tests on all versions of php, make sure each db is run at least once matrix: include: - - php: 5.5 - dist: trusty + - php: 5.6 env: DB="postgresql" DB_USER="postgres" - php: 5.6 env: DB="mysql" DB_USER="root" diff --git a/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php b/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php index 1b0f341611e..97ef51e7902 100644 --- a/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php +++ b/kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php @@ -215,7 +215,6 @@ function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute ) { $content['relation_list'] = array(); $contentObjectAttribute->setContent( $content ); - $contentObjectAttribute->store(); return true; } // Type is browse and we have no http input diff --git a/kernel/private/classes/ezcontentobjectstate.php b/kernel/private/classes/ezcontentobjectstate.php index 27f320aa2fe..1d1f115d53a 100644 --- a/kernel/private/classes/ezcontentobjectstate.php +++ b/kernel/private/classes/ezcontentobjectstate.php @@ -67,6 +67,7 @@ static function definition() */ public static function fetchById( $id ) { + $id = (int)$id; $states = self::fetchByConditions( array( "ezcobj_state.id=$id" ), 1, 0 ); $state = count( $states ) > 0 ? $states[0] : false; return $state; @@ -145,6 +146,7 @@ private static function fetchByConditions( $conditions, $limit, $offset ) */ public static function fetchByGroup( $groupID, $limit = false, $offset = false ) { + $groupID = (int)$groupID; return self::fetchByConditions( array( "ezcobj_state_group.id=$groupID" ), $limit, $offset ); } diff --git a/kernel/private/classes/ezcontentobjectstategroup.php b/kernel/private/classes/ezcontentobjectstategroup.php index 8ef56dc738a..008ab006dc7 100644 --- a/kernel/private/classes/ezcontentobjectstategroup.php +++ b/kernel/private/classes/ezcontentobjectstategroup.php @@ -65,6 +65,7 @@ public static function definition() */ public static function fetchById( $id ) { + $id = (int)$id; $stateGroups = self::fetchByConditions( array( "ezcobj_state_group.id=$id" ), 1, 0 ); $stateGroup = count( $stateGroups ) > 0 ? $stateGroups[0] : false; return $stateGroup; diff --git a/kernel/shop/discountruleedit.php b/kernel/shop/discountruleedit.php index b64f252d503..e0ab3145f23 100644 --- a/kernel/shop/discountruleedit.php +++ b/kernel/shop/discountruleedit.php @@ -46,9 +46,9 @@ 'discountrule_id' => $discountRuleID ), 'persistent_data' => array( 'discountrule_name' => $http->postVariable( 'discountrule_name' ), 'discountrule_percent' => $http->postVariable( 'discountrule_percent' ), - 'Contentclasses' => ( $http->hasPostVariable( 'Contentclasses' ) )? serialize( $http->postVariable( 'Contentclasses' ) ): '', - 'Sections' => ( $http->hasPostVariable( 'Sections' ) )? serialize( $http->postVariable( 'Sections' ) ): '', - 'Products' => ( $http->hasPostVariable( 'Products' ) )? serialize( $http->postVariable( 'Products' ) ): '' ), + 'Contentclasses' => ( $http->hasPostVariable( 'Contentclasses' ) )? json_encode( $http->postVariable( 'Contentclasses' ) ): '', + 'Sections' => ( $http->hasPostVariable( 'Sections' ) )? json_encode( $http->postVariable( 'Sections' ) ): '', + 'Products' => ( $http->hasPostVariable( 'Products' ) )? json_encode( $http->postVariable( 'Products' ) ): '' ), 'from_page' => "/shop/discountruleedit/$discountGroupID/$discountRuleID" ), $module ); return; @@ -68,7 +68,7 @@ $discountRuleSelectedClasses = $http->postVariable( 'Contentclasses' ); if ( !is_array( $discountRuleSelectedClasses ) ) { - $discountRuleSelectedClasses = unserialize( $discountRuleSelectedClasses ); + $discountRuleSelectedClasses = json_decode( $discountRuleSelectedClasses ); } } @@ -78,7 +78,7 @@ $discountRuleSelectedSections = $http->postVariable( 'Sections' ); if ( !is_array( $discountRuleSelectedSections ) ) { - $discountRuleSelectedSections = unserialize( $discountRuleSelectedSections ); + $discountRuleSelectedSections = json_decode( $discountRuleSelectedSections ); } } @@ -88,7 +88,7 @@ $discountRuleSelectedProducts = $http->postVariable( 'Products' ); if ( !is_array( $discountRuleSelectedProducts ) ) { - $discountRuleSelectedProducts = unserialize( $discountRuleSelectedProducts ); + $discountRuleSelectedProducts = json_decode( $discountRuleSelectedProducts ); } } diff --git a/lib/ezutils/classes/eztimestamp.php b/lib/ezutils/classes/eztimestamp.php index fcbecd85b23..6e952f05ffb 100644 --- a/lib/ezutils/classes/eztimestamp.php +++ b/lib/ezutils/classes/eztimestamp.php @@ -14,6 +14,12 @@ class eZTimestamp \return a timestamp in UTC */ public static function getUtcTimestampFromLocalTimestamp( $localTimestamp ) { + + if ( $localTimestamp === null || $localTimestamp === '' ) + { + return null; + } + $utcTimezone = new \DateTimeZone( 'UTC' ); $localTimezone = new \DateTimeZone( date_default_timezone_get() ); @@ -28,6 +34,12 @@ public static function getUtcTimestampFromLocalTimestamp( $localTimestamp ) { \return a timestamp in timezone defined in php.ini */ public static function getLocalTimestampFromUtcTimestamp( $utcTimestamp ) { + + if ( $utcTimestamp === null || $utcTimestamp === '' ) + { + return null; + } + $utcTimezone = new \DateTimeZone( 'UTC' ); $localTimezone = new \DateTimeZone( date_default_timezone_get() ); diff --git a/settings/contentstructuremenu.ini b/settings/contentstructuremenu.ini index d763b79d23e..98d0d492126 100644 --- a/settings/contentstructuremenu.ini +++ b/settings/contentstructuremenu.ini @@ -36,9 +36,8 @@ MaxNodes=150 # SortBy[] # SortBy[]=name/ascending # SortBy[]=published/descending -# if set to "false" - default sorting will be implemented -# (which is defined for each node) -SortBy=false +# if an empty array, it uses the sorting defined for each node instead (from the Ordering tab) +SortBy[] # enabled/disabled ToolTips=enabled