Skip to content

Fix code file upload #2453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cookbook/doctrine/file_uploads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
// the entity from being persisted to the database on error
$this->getFile()->move($this->getUploadRootDir(), $this->path);

$this->setFile(null);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the extra 2 lines


// check if we have an old image
if (isset($this->temp)) {
Expand All @@ -417,6 +417,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
// clear the temp image path
$this->temp = null;
}
$this->setFile(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change this line to $this->file = null
also can you please change the same line in the upload function of the "Using the id as the filename" section ?

}

/**
Expand Down