Problem/Motivation

Over in #2320245: High water should consistently be two words jhodgdon noticed that there was a code path in Drupal\migrate\Source.php that is never used.

Code in question:

      // 4. At this point, we have a row which has previously been imported and
      //    not marked for update. If we're not using high water marks, then we
      //    will not take this row. Except, if we're looking for changes in the
      //    data, we need to go through prepareRow() before we can decide to
      //    skip it.
      elseif (!empty($this->highWaterProperty['field'])) {
        if ($this->trackChanges) {
          if ($this->prepareRow($row) !== FALSE) {
            if ($row->changed()) {
              // This is a keeper
              $this->currentRow = $row;
              break;
            }
            else {
              // No change, skip it.
              continue;
            }
          }
          else {
            // prepareRow() told us to skip it.
            continue;
          }
        }
        else {
          // No high water and not tracking changes, skip.
          continue;
        }
      }

Until #2320245: High water should consistently be two words this line wasn't even referring to an existing field:

elseif (!empty($this->highWaterProperty['field'])) {

We changed it in that issue to $this->highWaterProperty which is the correct field, we now need to test if the functionality works and add some tests.

Proposed resolution

* Figure out what this block of code does.
* Test the code path
* Add some automated tests to stop the issues arising again.

Remaining tasks

Discuss the code and write a patch

User interface changes

n/a

API changes

n/a

Comments

benjy’s picture

Status: Active » Closed (duplicate)

This entire code path got a rewrite with tests in #2427335: Combine legacy Source class into SourcePluginBase