From 49fdd9645cd5be261100c043bd472d8c9fa1a55e Mon Sep 17 00:00:00 2001 From: Sebastien Heraud Date: Wed, 20 Mar 2024 09:58:30 +0100 Subject: [PATCH] Quick Fix on Exporter classes --- .../joomla_article/classes/exporter.php | 8 ++++++-- .../joomla_category/classes/exporter.php | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/cck_storage_location/joomla_article/classes/exporter.php b/plugins/cck_storage_location/joomla_article/classes/exporter.php index 180bb64b3..e5c59997b 100644 --- a/plugins/cck_storage_location/joomla_article/classes/exporter.php +++ b/plugins/cck_storage_location/joomla_article/classes/exporter.php @@ -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] ) ) { @@ -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]; + } } } } diff --git a/plugins/cck_storage_location/joomla_category/classes/exporter.php b/plugins/cck_storage_location/joomla_category/classes/exporter.php index c1c55570d..076ef6f43 100644 --- a/plugins/cck_storage_location/joomla_category/classes/exporter.php +++ b/plugins/cck_storage_location/joomla_category/classes/exporter.php @@ -163,7 +163,10 @@ 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 ) { @@ -171,7 +174,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]; + } } } }