Skip to content
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

File are not correctly uploaded as attachment when saving a doctype with a field attach #14422

Closed
jbtruffault opened this issue Oct 11, 2021 · 3 comments
Assignees
Labels

Comments

@jbtruffault
Copy link

jbtruffault commented Oct 11, 2021

Description of the issue

I try to upload a file through the attach field from a custom doctype.
image

When I save the new document with an attachment, I get this error message (it means: "file /private/files/MyFile.txt does not exist):
image

For debug, I looked into the JS console where I found this error:
image

I also had a look into the network history where I found a response “DoesNotExistError” to the request to /api/method/upload_file
image

At this point, my document is saved, but not any file has been saved in the folder /private/file. But, once the document is saved, when I change the attached file or reload it from the attach field
image

And now, the file is correctly uploaded.
image

Context information (for bug reports)

frappe version: 13.11.0
I am the Administrator, I have all the permissions.
The folder /private/files is owned by the user frappe on the system.

Output of bench version

frappe 13.11.0
erpnext 13.11.0
mymodule 0.0.1

Steps to reproduce the issue

  1. Upload a file through a attach field
  2. Once the document has been saved, reload the attached file

Observed result

The file is not uploaded when the document is saved, it is uploaded when I reload it after the document has been saved.

Expected result

I would like the file to be uploaded when I save the document.

Stacktrace / full error message

None

Additional information

Version installed through docker_frappe

@jbtruffault
Copy link
Author

jbtruffault commented Oct 28, 2021

Dears,
I am still facing this issue, I am still interesting for any suggestion or any help !

I have more details about the bug here after:


Before saving my new document, just after upload a new file:
image
At this moment, not any file has been created on the server.

But, if I use the function "Clear" ("Clair" above in french), and that I upload the same document. Now there is a file that is created on the server in the folder private/files.

@jbtruffault
Copy link
Author

jbtruffault commented Oct 29, 2021

I realized that the file is actually written on the server, but it is removed by the function "on_rollback()"

V13.13.0:

def on_rollback(self):

It seems that this function has been edited in this commit: bc596e9 This commit may fix my issue.

But it's not in the production branch yet. Do you have any information about the release of this fix ?

Regards

@Nihantra-Patel
Copy link
Contributor

Hi @jbtruffault,

We no longer provide support for version 13 or older.

Kindly upgrade to version 14 or 15, then refresh and check again because lots of bugs fixed in the new version.

Everything is working fine. No problems were encountered in the latest versions 14 and 15.

scrnli_21_03_2024_17-06-36.mp4
Version EOL Branch
Version 12 End of 2022 version-12
Version 13 End of 2023 version-13
Version 14 End of 2024 (planned) version-14
Version 15 End of 2026 (planned) version-15
Bleeding edge N/A develop

For more information, please refer to the guidelines.

Thank You!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants