From 4b46b2fa8a2f9504bd4d828f30838d4ba57efad4 Mon Sep 17 00:00:00 2001 From: Sebastien Heraud Date: Mon, 10 Oct 2022 00:32:40 +0200 Subject: [PATCH] Fix Field Import (J! 4.x) --- libraries/cck/base/install/import.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/cck/base/install/import.php b/libraries/cck/base/install/import.php index c2ff3823b..ca2a21ac7 100644 --- a/libraries/cck/base/install/import.php +++ b/libraries/cck/base/install/import.php @@ -110,7 +110,12 @@ public static function importElement( $elemtype, $path, &$data, $config = array( if ( $pk > 0 ) { $item->id = $pk; } - $item->store(); + + // TODO later: ->check() + + if ( !$item->store() ) { + // var_dump( $item->getError() ); + } $call = 'afterImport'.$elemtype; self::$call( $xml, $elemtype, $item, $data ); } @@ -170,6 +175,9 @@ public static function beforeImportField( $elemtype, &$item, $data, $config = ar require_once JPATH_SITE.'/plugins/cck_field/'.$item->type.'/classes/app.php'; JCck::callFunc_Array( 'plgCCK_Field'.$item->type.'_App', 'onCCK_FieldImportField', array( &$item, $data ) ); } + if ( is_null( $item->storage_key ) ) { + $item->storage_key = ''; + } return $pk; }