Hi,

I have noticed an issue with the activeUrl() function in the MigrateSourceXML class (xml.inc). The current function checks the activeUrl attribute in an if statement as follows:

  public function activeUrl() {
    if ($this->activeUrl) {
      return $this->sourceUrls[$this->activeUrl];
    }
  }

The problem arises importing XML from multiple files if you need to get the URI of the first file, at index 0. PHP treats 0 as FALSE so the sourceUrl will never be returned for this file.

To fix this, we simply need to change the if statement to check explicitly for NULL rather than the truth value of $this->activeUrl.

Patch incoming.

CommentFileSizeAuthor
#1 activeurl-1836426-1.patch412 bytesedb

Comments

edb’s picture

Status: Active » Needs review
StatusFileSize
new412 bytes

Patch attached

mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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