Skip to content

Commit

Permalink
Quick Fix on Exporter classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienheraud committed Mar 20, 2024
1 parent 8da279a commit 49fdd96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ public static function onCCK_Storage_LocationExport( $items, &$config = array()
if ( $hasCustomValue ) {
preg_match_all( '#::(.*?)::(.*?)::/(.*?)::#s', $custom_value, $values );

$tables[self::$table][$item->pk]->{self::$custom} = array();
if( isset( $tables[self::$table]) && is_object( $tables[self::$table][$item->pk]) ) {
$tables[self::$table][$item->pk]->{self::$custom} = array();
}
$fields[self::$custom] = '';

if ( count( $values[1] ) ) {
Expand All @@ -201,7 +203,9 @@ public static function onCCK_Storage_LocationExport( $items, &$config = array()
// DISPATCH --> EXPORT
$fields[self::$custom] = $values[2][$k];
} elseif ( !isset( $excluded2[$v] ) ) {
$tables[self::$table][$item->pk]->{self::$custom}[$v] = $values[2][$k];
if( isset( $tables[self::$table]) && is_object( $tables[self::$table][$item->pk]) ) {
$tables[self::$table][$item->pk]->{self::$custom}[$v] = $values[2][$k];
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,20 @@ public static function onCCK_Storage_LocationExport( $items, &$config = array()
// Core > Custom
if ( self::$custom && isset( $fields[self::$custom] ) ) {
preg_match_all( '#::(.*?)::(.*?)::/(.*?)::#s', $fields[self::$custom], $values );
$tables[self::$table][$item->pk]->{self::$custom} = array();

if( isset( $tables[self::$table]) && is_object( $tables[self::$table][$item->pk]) ) {
$tables[self::$table][$item->pk]->{self::$custom} = array();
}
$fields[self::$custom] = '';
if ( count( $values[1] ) ) {
foreach ( $values[1] as $k=>$v ) {
if ( $v == self::$custom ) {
// DISPATCH --> EXPORT
$fields[self::$custom] = $values[2][$k];
} elseif ( !isset( $excluded2[$v] ) ) {
$tables[self::$table][$item->pk]->{self::$custom}[$v] = $values[2][$k];
if( isset( $tables[self::$table]) && is_object( $tables[self::$table][$item->pk]) ) {
$tables[self::$table][$item->pk]->{self::$custom}[$v] = $values[2][$k];
}
}
}
}
Expand Down

0 comments on commit 49fdd96

Please sign in to comment.