feed-me
feed-me copied to clipboard
Custom Source breaks Feed Map
Description
If an Entries field has been set to use a Custom Source, an error is returned.
Trying to access array offset on value of type null
public function getSelectOptions($options, $label = 'name', $index = 'id', $includeNone = true): array
{
$values = [];
if ($includeNone) {
if (is_string($includeNone)) {
$values[''] = $includeNone;
} else {
$values[''] = 'None';
}
}
if (is_array($options)) {
foreach ($options as $value) {
if (isset($value['optgroup'])) {
continue;
}
$values[$value[$index]] = $value[$label];
}
}
return $values;
}
Line 96 of vendor/craftcms/feed-me/src/web/twig/variables/FeedMeVariable.php
.
This appears to breaks the Select field that is displayed if Create entries if they do not exist
is ticked, as the field assumes a Section/Entry Type structure that is not present.
Steps to reproduce
- Create Custom Source on Entries screen
- Create Entries field that allows this custom source to be selected
- Assign Entries field to an Entry Type
- Select this Entry Type for a FeedMe import
- Progress to 'map' screen
Additional info
- Craft version: 4.2.1.1
- PHP version: 8.0
- Database driver & version: MySQL
- Plugins & versions: FeedMe 5.0.4