Update widget layout

Expected behavior

When trying to select the display widget by file on one of my models it should save properly.

Actual behavior

when I wish to have a display widget by file on one of my models it fails with a 400 error.

Failure Logs

@jeffladiray, thanks for your help :slight_smile: !

1 Like


Sadly, I’m currently not able to reproduce your issue.

The issue seems to be related to the -logo added in the /api/fields/xxx URL, but I’m not sure how this happend. If that’s possible on your end, could you provide the HTTP request + response associated to this failling call, and any specific configuration you could have made that can cause this issue ?
I might have more luck reproducing on my end with theses infos :smiley:

Thanks !

thanks for investigating @jeffladiray

Here are the informations about the request

Request URL: https://api.forestadmin.com/api/fields/c1334430-9a38-11ea-996f-51473970f120-logo
Request Method: PUT
Status Code: 400 Bad Request
Remote Address:
Referrer Policy: no-referrer-when-downgrade

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: https://app.forestadmin.com
Connection: keep-alive
Content-Length: 60
Content-Type: application/json; charset=utf-8
Date: Thu, 23 Jul 2020 16:50:55 GMT
Etag: W/“3c-speXrJIeoykLjM9ink01HbZvv9o”
Server: Cowboy
Strict-Transport-Security: max-age=15552000; includeSubDomains
Vary: Origin, Accept-Encoding
Via: 1.1 vegur
X-Content-Type-Options: nosniff
X-Dns-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block

ccept: vnd.forestadmin-api+json; version=2.8.0
Accept-Encoding: gzip, deflate, br
Accept-Language: en-CA,en;q=0.9,fr-CA;q=0.8,fr;q=0.7,en-GB;q=0.6,en-US;q=0.5
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImRhdGEiOnsidHlwZSI6InVzZXJzIiwiaWQiOiIzMjcwNCIsImF0dHJpYnV0ZXMiOnsiZmlyc3RfbmFtZSI6IkJlbmphbWluIiwibGFzdF9uYW1lIjoiTWFycXVpcyIsImVtYWlsIjoiYmVuamFtaW5AY29tbWluaXR5LmNhIn19fSwiaWF0IjoxNTk0MjQyODAwLCJleHAiOjE2MDk3OTQ4MDAsImF1ZCI6IkZPUkVTVF9VU0VSUyIsImlzcyI6IkZPUkVTVF9BVVRIRU5USUNBVElPTl9TWVNURU0ifQ
Connection: keep-alive
Content-Length: 779
Content-Type: application/vnd.api+json
Cookie: _uc_referrer=direct; ajs_anonymous_id=%22167f48c0-2fbc-4f19-89bc-4da90ccf0a3b%22; _ga=GA1.2.879640001.1591278077; ajs_user_id=%2232704%22; session_token=dIONQlegH-bQunLqRy_V5DnuXw9MFgiFyeBQcZNG6RM; _fbp=fb.1.1594939335441.749455260; _gid=GA1.2.8436967.1595246404; amplitude_id_fef1e872c952688acd962d30aa545b9eforestadmin.com=eyJkZXZpY2VJZCI6ImRmMDM2Y2QzLTAxNTAtNDg4NC05MzkzLWI0MjI0MzRlODNkM1IiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTU5NTQyNzgxNjA0OSwibGFzdEV2ZW50VGltZSI6MTU5NTQyNzgxNjMxMiwiZXZlbnRJZCI6MSwiaWRlbnRpZnlJZCI6MSwic2VxdWVuY2VOdW1iZXIiOjJ9; _gat_UA-67872253-1=1; _gat=1
Forest-Collection-Id: c1334430-9a38-11ea-996f-51473970f120
Forest-Environment-Id: 54545
Forest-Project-Id: 45191
Forest-Rendering-Id: 64618
Forest-Team-Id: 45033
Host: api.forestadmin.com
Origin: https://app.forestadmin.com
Referer: https://app.forestadmin.com/Tooly-MVP/Production/First%20team/data/c1334430-9a38-11ea-996f-51473970f120/settings/fields/logo
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36

{“data”:{“id”:“c1334430-9a38-11ea-996f-51473970f120-logo”,“attributes”:{“field”:“logo”,“display_name”:“logo”,“type”:“String”,“relationship”:null,“description”:null,“reference”:null,“inverseOf”:null,“default_value”:null,“integration”:null,“enums”:null,“position”:null,“is_virtual”:false,“is_filterable”:false,“is_read_only”:false,“is_sortable”:true,“is_required”:false,“widget_edit”:null,“widget_display”:{“name”:“file viewer”,“parameters”:{“prefix”:null,“allowRotation”:true,“allowZoom”:true,“size”:“medium”}},“mapping_values”:},“relationships”:{“instance_parameters”:{“data”:},“collection”:{“data”:{“type”:“collections”,“id”:“c1334430-9a38-11ea-996f-51473970f120”}},“row_edit”:{“data”:{“type”:“row-edits”,“id”:“c1334430-9a38-11ea-996f-51473970f120-logo”}}},“type”:“fields”}}

About spec configuration I dont think they play a role here, I do not have this issue with dev or beta (stagging) environement, and they share the same Kubernetes Cluster let me know if you want any info related to the cluster!

Hi @Benjamin_Marquis,

Is this logo field deployed in all your environments?
And does this configuration error happen in all your environments?

Thanks for your help.

Hi @arnaud thanks for your help, yes this logo is in all environment but the error only happens in production

Hi @Benjamin_Marquis,

After digging your issue up on our end, I’ve been able to see that the “logo” field was not present on your layout. I can’t exactly figure out why but I triggered a refresh of your layout. It should know contain the logo field and you should be able to perform any action on it

Of course let me know if the issue persist

Hi @lamatt_v thanks for helping ! It does work now, any way to refresh the layout from our side ?

Theoretically you could by pushing a new version of your .forestadmin-schema.json file.

For example if you add a new action on a collection on a development environment, a new version of the file will be generated then pushing it to production and restarting your server should regenerate your layout.

However, I’d strongly discourage you from doing so just to trigger a refresh of your layout. This is only intended to be refresh when needed and triggering manual refresh could lead to unexpected behavior that might be tough for us to help you with.

If ever a similar issue would happen, please reach out to our community and someone will do his best to assist you with your issue.

1 Like

Great, understood. Thanks again for your help!

1 Like