-
-
Notifications
You must be signed in to change notification settings - Fork 213
Dbafs does not handle files that are being replaced #7828
Comments
|
That's actually correct, because |
|
Hmm...still, that method should be centralized, no? |
|
👍 I also think this should be done in |
|
As discussed on Mumble on October 14th, we should update the timestamp and file hash in the |
|
I have been working on this one today and it turned out that it is not a good idea to always update the folder hash (as @ausi already mentioned). In the core, we are using So there are two possible implementations: // 1. Always update the folder hash but check for existence beforehand
$file = FilesModel::findByPath('…');
if (null === $file) {
$file = Dbafs::addResource($file);
}
// do something with $file// 2. We add another flag to the method
$file = Dbafs::addResource($file, true, true); // the second true means "update the hash"I tend to number 1, because I think it is wrong to use @contao/developers Any objections against implementation no. 1? |
|
👍 for 1. |
|
Changed in contao/core-bundle@dcb46f3. |
I just digged into the
Dbafsclass once again and I found that when I do thisthe md5 hash is not updated. I found that you do that check here: https://github.com/contao/core/blob/develop/system/modules/core/drivers/DC_Folder.php#L920-L933
However, I think that's wrong because then everybody has to do that? It should be done in
Dbafs::addResource(), right?The text was updated successfully, but these errors were encountered: