Skip to content

Commit

Permalink
Merge remote-tracking branch 'ezsystems/2019.03' into 2024-update
Browse files Browse the repository at this point in the history
  • Loading branch information
runelangseid committed Mar 21, 2024
2 parents 7e3ab82 + 4356467 commit ad3605e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions kernel/private/classes/ezcontentobjectstate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}

Expand Down
1 change: 1 addition & 0 deletions kernel/private/classes/ezcontentobjectstategroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions kernel/shop/discountruleedit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -68,7 +68,7 @@
$discountRuleSelectedClasses = $http->postVariable( 'Contentclasses' );
if ( !is_array( $discountRuleSelectedClasses ) )
{
$discountRuleSelectedClasses = unserialize( $discountRuleSelectedClasses );
$discountRuleSelectedClasses = json_decode( $discountRuleSelectedClasses );
}
}

Expand All @@ -78,7 +78,7 @@
$discountRuleSelectedSections = $http->postVariable( 'Sections' );
if ( !is_array( $discountRuleSelectedSections ) )
{
$discountRuleSelectedSections = unserialize( $discountRuleSelectedSections );
$discountRuleSelectedSections = json_decode( $discountRuleSelectedSections );
}
}

Expand All @@ -88,7 +88,7 @@
$discountRuleSelectedProducts = $http->postVariable( 'Products' );
if ( !is_array( $discountRuleSelectedProducts ) )
{
$discountRuleSelectedProducts = unserialize( $discountRuleSelectedProducts );
$discountRuleSelectedProducts = json_decode( $discountRuleSelectedProducts );
}
}

Expand Down
12 changes: 12 additions & 0 deletions lib/ezutils/classes/eztimestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );

Expand All @@ -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() );

Expand Down
5 changes: 2 additions & 3 deletions settings/contentstructuremenu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad3605e

Please sign in to comment.