V8-archive: Attempting to write an array as the value for field "value" in "directus_settings"

Created on 22 Jan 2019  Â·  9Comments  Â·  Source: directus/v8-archive

Bug Report

Directus Settings doesn't allow any other value to be saved than a String (which makes sense, cause all the columns are stored in the same string based column). That being said, it makes using non-string interfaces for directus_settings impossible (like tags for thumbnail_dimensions as it will throw an error

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

Steps to Reproduce

  1. Go to 'Settings'
  2. Enter a value for 'Thumbnail Dimensions"
  3. Save
  4. See error

Expected Behavior

directus_settings should accept the type as set in directus_fields. /settings should allow any type field and cast it to/from a string before saving.

Actual Behavior

API returns error if any non-string value is being saved.

bug

All 9 comments

@WellingGuzman The API should use the types as defined in directus_fields for the type checks in directus_settings before casting everything to a string in order to save it.

Is there any way to get several thumbnail sizes into the configuration? I only have the standard 200x200 in the list. Is there a way to manipulate the setting in MYSQL directly or any other workaround?

@neonnoe — Yeah, it's annoying but we're finally fixing this. In the meantime, just add a CSV of sizes to the database:

directus_settings with the thumbnail_dimensions key:

200x200,1500x400,300x400

@benhaynes Thanks for the this. Works perfectly.

@benhaynes This should be fixed by https://github.com/directus/api/pull/821
But as we discussed, we can still improve the thumbnail configuration.

Cool. Here is the referenced ticket for improving the thumb saving format:

https://github.com/directus/api/issues/813

@rijkvanzanten @theharshin — is this fixed now? Should we close this ticket?

Yes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rijkvanzanten picture rijkvanzanten  Â·  3Comments

Nitwel picture Nitwel  Â·  3Comments

binary-koan picture binary-koan  Â·  3Comments

magikstm picture magikstm  Â·  3Comments

maettyhawk picture maettyhawk  Â·  3Comments