Unverified Commit c61a9d4b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3189878 by Matroskeen: Remove temporaryPath property from d7/File source plugin

parent 118b1c33
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -29,13 +29,6 @@ class File extends DrupalSqlBase {
   */
  protected $privatePath;

  /**
   * The temporary file directory path.
   *
   * @var string
   */
  protected $temporaryPath;

  /**
   * {@inheritdoc}
   */
@@ -73,7 +66,6 @@ public function query() {
  protected function initializeIterator() {
    $this->publicPath = $this->variableGet('file_public_path', 'sites/default/files');
    $this->privatePath = $this->variableGet('file_private_path', NULL);
    $this->temporaryPath = $this->variableGet('file_temporary_path', '/tmp');
    return parent::initializeIterator();
  }

@@ -83,7 +75,7 @@ protected function initializeIterator() {
  public function prepareRow(Row $row) {
    // Compute the filepath property, which is a physical representation of
    // the URI relative to the Drupal root.
    $path = str_replace(['public:/', 'private:/', 'temporary:/'], [$this->publicPath, $this->privatePath, $this->temporaryPath], $row->getSourceProperty('uri'));
    $path = str_replace(['public:/', 'private:/'], [$this->publicPath, $this->privatePath], $row->getSourceProperty('uri'));
    // At this point, $path could be an absolute path or a relative path,
    // depending on how the scheme's variable was set. So we need to shear out
    // the source_base_path in order to make them all relative.