-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Using
- ImportX 1.2.1-pl
- MODX 3.1.2-pl
Observation
I am importing several resources with ImportX, and I noted it always imports resources with the class_key to MODX\Revolution\modDocument regardless of the csv/data I insert into ImportX.
Suggestion / Fix
The issue appears to be due to the setDefaultClassKey function. Line 104 (the if statement) is checking if $line['class_key'] is empty, it should however be checking $record['class_key']
protected function setDefaultClassKey(array $record): array
{
$modxVersion = $this->modx->getVersionData();
if (version_compare($modxVersion['full_version'], '3.0.0-dev', '>=') && empty($record['class_key'])) { // Note: using $record['class_key'] here
$record['class_key'] = 'MODX\Revolution\modDocument';
}
return $record;
}muzzwood
Metadata
Metadata
Assignees
Labels
No labels