Score:0

Webform update from 5.3.0 to 6.1.0 results in directory error

us flag

After I updated my webform module from 5.3.0 to 6.1.0 I received an error when submitting my form. Apparently it isn't able to copy the pdf file which I added to the form and so it is blocking the submit and giving me a white page.

Here's what I have in my recent log entry:

Drupal\Core\Entity\EntityStorageException:
The specified file 'private://webform/saisie_du_bilan/_sid_/projet-985.pdf' could not be copied because the destination directory is not properly configured.
This may be caused by a problem with file or directory permissions.
in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of /home/acelys/www/uno-test.agglonet.com/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

What does the phrase : could not be copied because the destination directory is not properly configured mean? I searched on Internet without success.

I also looked into the file permissions and it is 775.

SOLVED: I needed to give full permission chmod -R 777 webform to the private/webform directory (private directory is created outside the $root_dir which is the /web directory).

berliner avatar
bd flag
Hi there! Welcome to Drupal Answers! Did you check the permissions on both the temporary and the final destination directory?
OmarAc avatar
us flag
Hi ! thank you! @berliner , the final destination file yes, the tmp i don't know where it is, do you have an idea where it is ? Thanks.
berliner avatar
bd flag
You can find that out on the file system config page: `/admin/config/media/file-system`
OmarAc avatar
us flag
@berliner i have looked into it, it is well configured, I'm wondering if it is a problem in the new version of webform, which needs the path to be defined differently ...
berliner avatar
bd flag
I have little experience with webform, so I can't say anything about that. But you can debug a bit to see which directory it's complaining about. Unless you're already on Drupal 9 (which I assume you are not), you can add a debug statement to https://github.com/drupal/drupal/blob/8.9.x/core/lib/Drupal/Core/File/FileSystem.php#L484 which is where that error message originates.
OmarAc avatar
us flag
**SOLVED**: I needed to give full permission `chmod -R 777 webform` to the private/webform directory (private directory is created outside the $root_dir: /web/ dir)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.