In the XML parser, which is based on XMLReader thus does not have the full context of the XML source available for retrieval via xpath, there's some limited support for reaching outside of the current item via parentXpathCache and parentElementsOfInterest. This is not currently working - getAncestorElements() is where the magic should be happening, but nothing calls it. We need to fix this...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeryan created an issue. See original summary.

patrick_durold’s picture

I've stumbled onto this problem today while working with migrate_source_xml and patched that module. Seeing as the source code here is basically still the same, I suppose the patch will still work, though I couldn't really test it.

mikeryan’s picture

Status: Active » Needs review
megadesk3000’s picture

Hi

I tested patricks patch, and it did not totally solve the problem in my opinion.
Additionally we need to change

if (array_key_exists($this->reader->name, $this->parentElementsOfInterest)) {

with

if (in_array($this->reader->name, $this->parentElementsOfInterest)) 

Status: Needs review » Needs work

The last submitted patch, 4: migrate_plus-fix-parent-elements-2742233-4.patch, failed testing.

megadesk3000’s picture

FileSize
1.97 KB

Sorry, had wrong patch format.

mikeryan’s picture

Status: Needs work » Needs review

mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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