Here is a patch what solves a php notice and makes the things simplier.
In _feedapi_mapper_get_field_mappers_descriptions() there is a $field_name which is undefined all the time. Here we create a nested array. Why? I cannot see any reason to do this, also i could not find any possible drawbacks of flattening this array.

Comments

alex_b’s picture

The reason for keying the descriptions array by module and field name is that thus more than one module can offer mapping for a specific field name (e. g. an alternative taxonomy mapper).

aron novak’s picture

$descriptions_filtered[''][$module] = $descriptions[''][$module];

But it seems that $field_name is always empty.
(edit: it's about the description generating, not about the select form item's list)

neclimdul’s picture

Yeah, as Aron noted in the first post, $field_name is undefined in _feedapi_mapper_get_field_mappers_descriptions which is causes the weird line he pasted in #2 to be needed. We never actually take advantage of this field_name separation in our code at any point and the descriptions are so separate from the field names that its probably best to remove this.

neclimdul’s picture

Status: Needs review » Reviewed & tested by the community

Also, #397650: Improve and separate mapping UI makes the separation even more prevalent. Think we should go with this.

alex_b’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new2.23 KB

Ok. This is committed.

I had to clean up a small problem with determing available modules (iteration did not step into nested sub fields).

For the record, the patch that got committed.

I am not 100 % happy on how feedapi mapper filters out descriptions after querying them by a test against $field_map because this test is a bit messy. But this goes beyond the scope of this issue.

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.