V8-archive: Can't upload logo in Global Settings

Created on 20 Nov 2018  ยท  32Comments  ยท  Source: directus/v8-archive

Hi,

I was trying to upload logo in Global Settings in Directus 7.0.8 version and it gives error stating "Attempting to write an array as the value for field "value" in "directus_settings""

On checking error log file, I found [2018-11-20 12:23:45] api[_].ERROR: Directus\Database\Exception\SuppliedArrayAsColumnValue: Attempting to write an array as the value for field "value" in "directus_settings" in {path}/{To}/{directus708}/src/core/Directus/Database/TableGateway/BaseTableGateway.php:1737

Also while updating color from the global settings, it gives "scope: This value should not be blank." error.

[2018-11-20 12:26:16] api[_].ERROR: Directus\Validator\Exception\InvalidRequestException: value: This value should not be blank. in {path}/{To}/{directus708}/src/core/Directus/Services/AbstractService.php:188

What is causing this ?

bug

Most helpful comment

I don't know if this may be related but I am able to upload a logo (it seems) but saving the global settings always results in the following error:

scope: This value should not be blank.

displayed in a flash message at the rightmost bottom of the screen... any suggestion?

All 32 comments

Hmm, that's odd. We just implemented this a few days ago so perhaps there are a few issues... maybe DB migration problems?

Any ideas @rijkvanzanten ?

@jameswill โ€” how did you install 7.0.8? Clone, zip, Docker? Was it an upgrade from an older version or fresh?

I had a brief look and had the same errors on directus.app, haven't done any in-depth testing as to why though.

Ughh yeah I know why.. The file interface will send the value as a file object (eg _array_ in php) while the directus_settings logo field expects just a sting. This is most likely a misconfiguration in the database where the logo field in directus_settings is set up to use the string data type instead of the file datatype. I have to confirm this though

@jameswill โ€” how did you install 7.0.8? Clone, zip, Docker? Was it an upgrade from an older version or fresh?

I have installed through zip archive downloaded from https://github.com/directus/directus

It is a fresh install

I don't know if this may be related but I am able to upload a logo (it seems) but saving the global settings always results in the following error:

scope: This value should not be blank.

displayed in a flash message at the rightmost bottom of the screen... any suggestion?

I have the exact same issue. First hit with the Attempting to write an array as the value for field "value" in "directus_settings" and then when trying again with the same logo but also changing the color got the scope: This value should not be blank.

I looked in the database (in directus_fields) and logo in the directus_settings collection already has the type "file".

Is there anything I can do to fix this?

@WellingGuzman The API should use the directus_fields settings for directus_settings when updating settings. I think the API is using the datatype for the value column in directus_settings (string) instead of the datatype for the logo row in directus_fields (file) which causes the API to error out (because the file is an object instead of a string and doesn't "fit" the field).

I will work on making each setting record match their directus_fields type.

@stickgrinder you need to upgrade your database. it should removes the scope field from the directus_settings. You can read how to upgrade using the /update endpoint or the db:upgrade cli command.

@WellingGuzman many thanks for this information. I'll try ASAP.

@WellingGuzman @stickgrinder We've also recently added a update DB button in the settings menu if you prefer doing it from the admin app ๐Ÿ˜„

@WellingGuzman @stickgrinder We've also recently added a update DB button in the settings menu if you prefer doing it from the admin app smile

Wow! :D I should update the docker image I guess ;)

@stickgrinder Let us know if that worked for you. You also need to get the most recent version of your Directus in order to get the latest migration files used to upgrade the database.

OK, I just updated to the last docker images: I'm now running API v2.0.10 and application 7.0.10.

I upgraded the database both via the button in the app admin section that running bin/directus db:upgrade inside the container.

Still when I try to upload a file via backend, a flash message says Attempting to write an array as the value for field "value" in "directus_settings".

Did I miss something?

@stickgrinder nah that's the issue @wellingguzman is solving:

I will work on making each setting record match their directus_fields type.

The one solved by updating the DB was the missing column scope ๐Ÿ™ƒ

It was a bit confusing actually... I didn't get the reason to update the DB then :sweat_smile: sorry!
Anyway, great to see that the docker images are working like a charm! :smile:

Hi,

Issue still persists in Directus 7.0.11 version as well.

Hi guys,

I've installed the Directus suite, I've updated to the latest git commit (b0c93e7189a0a7a5292d8e9d265fc1b69d09150c) and I'm having too the same error while trying to save the logo :

Attempting to write an array as the value for field "value" in "directus_settings"

Tried to update DB via the admin app, nothing has changed either.
This is being tested on an AWS EC2 instance with an ordinary bitnami-lampstack-7.1.22-1-r40-linux-ubuntu-16.04-x86

Did you guys run a db:upgrade?

Just run it and re-tested it, same error though

I've just elevated today to the high priority board. We'll look into what's going on here first thing tomorrow (@WellingGuzman is off today).

This still is a problem that we need to fix. we will try to fix it as soon as possible. I will keep you all posted.

Has this been fixed? I'm getting the same issue when trying to upload a logo. I have a fresh master branch installed. I'm nervous to switch to the development branch because this is running in production currently for a client.

Still working on this one @devninjajeremy โ€” though it's high on our list.

Is there a workaround to set the logo in the meantime ?

Hi guys,
I am having the same issue with the logo as well. Any idea on a temporary fix ?

At the moment there's not temporary fix.

Hi, guys.
Is there is any progress on this?
Thank you.

Hey @gamito! This was actually fixed just now in https://github.com/directus/api/pull/821 ๐Ÿ˜„

Experiencing this error on 7.1 with Thumbnail Quality Tags and Thumbnail Actions

Have same issue with Thumbnail Quality Tags and Thumbnail Actions too

Still having the problem with the current latest version. Now, the logo gets 'saved' but the interface never shows it

The logo is being saved successfully. Just need to change some variables on APP side to reflect it. This PR should fix it. https://github.com/directus/app/pull/1510

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  ยท  3Comments

cdwmhcc picture cdwmhcc  ยท  3Comments

cdwmhcc picture cdwmhcc  ยท  3Comments

gitlabisbetterthangithub picture gitlabisbetterthangithub  ยท  3Comments

magikstm picture magikstm  ยท  3Comments