After sorting mappers the xpath parser key is incorrect and may become duplicated. For example, let's say you have 3 xpathparser items and they are orderd which results in the following order:

  1. xpathparser:0
  2. xpathparser:2
  3. xpathparser:1

With the current code the last key will be used, and 'xpathparser:' part is removed from it so we keep the value of 1 and then +1 to it to create the next key (for the mapping form select list). This will result in xpathparser:2 which as we can see above is already used.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Michsk’s picture

See it's been fixed already.

Anyway here's the patch i did, looks a bit cleaner but it's up to the maintainers.

twistor’s picture

Status: Needs review » Fixed

Yeah, that's one way to do it. If we could use anonymous functions I would definitely do it. No use implementing a public method just for this though.

Status: Fixed » Closed (fixed)

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