Existing default project. Made the migration changes in /config/api.php but I get the following error when I try to enter file library:
items.vue:260 Error: Invalid field "filename" in "directus_files"
at new O (directus-sdk.min.js:1)
at directus-sdk.min.js:1
(anonymous) @ items.vue:260
Can you please explain what has been changed?
Any change that has to be made in the database?
filename was renamed to filename_disk. Either a migration didn't run correctly, or there's still a point in the SDK / app where it explicitly tries to read filename.
In DB fields have been renamed so migration has run but filename_download and hash are empty on all old fields except any newly created ones.
This migration should've taken care of the empty private_hash column
Found the problem, pushing a fix now
Also make sure that you don't show the old filename column from the layout view (hit info in the top right, select filename_download instead of filename.
Sorry to reply on a closed thread and thank you for your fast response.
Can you please update the main directus repo with the fix as soon as possible?
Hi, I believe I'm having a similar issue after having to manually migrate. The private hashes naturally weren't generated after I inserted the old files directly into the new files table (changing filename to filename_disk and filename_download and keeping the other columns the same) and I'm wondering if there is still a way to generate this.
Looking at the code snippet given above, am I simply able to generate a list of random strings and insert those in place of them?
edit: apologies for commenting this after closing btw
@aSeriousDeveloper You should be able to force the migrations to run again by truncating the directus_migrations table.
That partially worked, which is good. However, file previews still seem to be broken in card view as well as in collections referencing the image. Opening the image in the file library shows that the image can be loaded, but viewing elsewhere shows the broken image icon.
There's no errors reported in the API, but the chrome console is reporting a 404 error, and the link its using is the following:
http://directus.localhost/{project-name}/assets/qy4wj2wt3hckgcoc?key=directus-medium-crop
I was able to find another location this is used, which is for the thumbnail urls of an image. However, this link is slightly different, in that it has the public folder twice:
http:\/\/directus.localhost\/public\/public\/{project-name}\/assets\/qy4wj2wt3hckgcoc?key=directus-small-crop
This link instead takes me to a 401 unauthorised error stating the following:
{
"error": {
"code": 3,
"message": "Unauthorized request",
"class": "Directus\\Exception\\UnauthorizedException",
"file": "C:\\xampp\\htdocs\\directus\\src\\helpers\\app.php",
"line": 286
}
}
It seems that the assets area exists, but its been generated in the wrong place (/public/public/ rather than just /public/). Do you know if there is a way to change this?
Apologies in advance if this is complicated and/or a bit edge-casey.
edit: here's my stack trace from the unauthorised exception, just realised this may be useful.
`[2019-12-10 19:02:41] api[public].ERROR: Directus\Exception\UnauthorizedException: Unauthorized request in C:\xampp\htdocs\directus\src\helpers\app.php:286
Stack trace:
I'll get back to you on that asap, working on something else rn
Most helpful comment
Sorry to reply on a closed thread and thank you for your fast response.
Can you please update the main directus repo with the fix as soon as possible?