Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

API returns wrong casing in nested fields /collections #833

Closed
rijkvanzanten opened this issue Mar 18, 2019 · 7 comments
Closed

API returns wrong casing in nested fields /collections #833

rijkvanzanten opened this issue Mar 18, 2019 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@rijkvanzanten
Copy link
Member

Bug Report

Note how the collection is called Test, but the related nested fields return the casing as test. It does get returned correctly on /fields however.

image

@rijkvanzanten rijkvanzanten added the bug Something isn't working label Mar 18, 2019
@rijkvanzanten rijkvanzanten added this to Needs triage in Bug Triage via automation Mar 18, 2019
@benhaynes
Copy link
Sponsor Member

Also seems like the cause of the "Manage Collection" button issue, right?

@rijkvanzanten
Copy link
Member Author

Why? How is that related?

@benhaynes
Copy link
Sponsor Member

I just assumed that there might be a connection between the case issue for collections and the endpoint for toggling "managed". But now that I think about it, things toggle correctly and it's just the App updating... so it's probably unrelated. :/

@rijkvanzanten
Copy link
Member Author

Yeah, and that's about collections, this is about fields 😉

@rijkvanzanten rijkvanzanten moved this from Needs triage to High priority in Bug Triage Mar 21, 2019
Bug Triage automation moved this from High priority to Closed Mar 22, 2019
@benhaynes benhaynes reopened this Mar 22, 2019
Bug Triage automation moved this from Closed to Needs triage Mar 22, 2019
@benhaynes benhaynes moved this from Needs triage to High priority in Bug Triage Mar 22, 2019
@binal-7span binal-7span added this to In Progress in v2.0.21 Mar 26, 2019
@binal-7span binal-7span self-assigned this Mar 26, 2019
@binal-7span
Copy link
Contributor

@benhaynes @rijkvanzanten

We need to look into below points to add capitalized table name in the system.

(1) MySQL have 'lower_case_table_names' system variable. The capitalization of the table only possible if this variable is enabled in a file at /etc/mysql/my.cnf.
There are three possible values for this [0,1,2] but the challenge is On Unix, the default value of lower_case_table_names is 0. On Windows, the default value is 1. On macOS, the default value is 2.
So if in the user's system it is disabled then they need to enable manually and for that, we have to check from the code base that what is the user's OS and whether it is enabled or not. You can find more details from https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html

(2) As this system variable is OS specific, a user needs to check it at the migration time too. So when someone wants to migrate the local Directus setup from Unix to Windows or Mac, this variable can create a problem.

What should be the best approach?

@benhaynes
Copy link
Sponsor Member

My opinion is: We should force lowercase when adding collections/fields through the App and API, but we should support any collections/fields that already have uppercase letters (added manually in the database, or that were from a migrated schema).

Then we don't need to do any checks. If they already have uppercase in their database then it must be allowed.

BUT, this means that when we show existing uppercase collections/fields that those App inputs must be disabled... and they should not "re-submit" the name to the API.

Does that make sense? Does that seem like a good solution? @rijkvanzanten @bjgajjar @hemratna

binal-7span added a commit to binal-7span/api that referenced this issue Mar 28, 2019
@binal-7span
Copy link
Contributor

@benhaynes As per the current code, the flow you have recommended is already there!
You can find the API changes in PR #859

@binal-7span binal-7span moved this from In Progress to Done in v2.0.21 Mar 28, 2019
Bug Triage automation moved this from High priority to Closed Apr 2, 2019
Lapsus pushed a commit to Lapsus/api that referenced this issue May 8, 2019
binal-7span pushed a commit that referenced this issue Jun 17, 2019
* pgsql 10 initial support

* email_notification column must be set as a boolean

* Handle unique column collisions

* BUG delta in revisions can be null

* BUG transformed the remaining lastInsertValue into getLastGeneratedId()

* Pass new item flag to o2m new items

Closes https://github.com/directus/app/issues/1418

* Don't show popover for 0 items / no template

Closes https://github.com/directus/app/issues/1397

* Bug fix (#848)

* Merge conflict resolve

* Handle item not found exception in collection detail API

* Extended the list of safe tags (#849)

As described in issue #832

* Issue fix #819 (#851)

* Mark adding new item as new in m2m

* Bump version

* Revert composer changes

* Issue fix #843 (#852)

* BUG searches with LIKE on non-textual columns

* Remove the extensions from the API

* Issue fix #847 (#857)

* Issue fix #833 (#859)

* Initial commit for documentation (#844)

* Revert "Initial commit for documentation (#844)" (#868)

This reverts commit 6e85d59.

* BUG Bypass Zend-db choice not to allow nullable boolean fields

* BUG field length were not taken into account

* CHORE dupliacted line

* BUG o2m working + post-alter table event dispatching

* Return object in delete after hook instead of onli ID (#882)

* Add fix for big file sizes

Closes #750

* Add migrations for hash and single-file

* Show correct fields in roles.users

For some reason the database column for options was empty

Closes https://github.com/directus/app/issues/1471

* Delete ISSUE_TEMPLATE.md

* security notice

* Add check for mod_php before setting php_value for upload size

This will prevent errors on systems that don't allow overriding the php
values from within the .htaccess files. This will only check for php 7+
though, as the mod_php directive is version specific. This is okay for
now, as we officially only support PHP 7.1+

* Change field width from integer to string

This will allow the app to render the fields in the correct widths
starting with v7.2.

* Issue fix #854 (#896)

* Add migrations for setting field notes and widths

Lays out the settings a bit nicer and adds setting descriptions.

Fixes https://github.com/directus/app/issues/1379

* Fix sort order of fields on install

* Increase specificity of migrations so it doesn't target non-settings

* Move collection notes to the DB

I'm aware that this makes them english only for the time being.
Once we implement the using the translation column in the app, we
can make them properly translatable.

* Fix abstraction name

* Add migrations for misc fields

Sorting of files, making a couple interfaces required, etc

* Bump version

* Fix: Wrong MIME for extentions in uppercase (#895)

* FEAT more events that invalidate the cache (#892)

* Allowing string relations (#800)

* emoji support for comments and bookmark names

* Use JSON interface for system collections

* Fixing custom primary key primary key column name (#881)

Swapping this variable seems to resolve the issue.

* Bump version

* Issue #885 (#898)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* Issue#885 - Done

* #885 Removed Test cases

* Issue #886 (#899)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* Issue#885 - Done

* Issue#886 - Done

* #886 Reverted unwanted code

* Issue #884 (#901)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #884 Done

* #884 Removed Test cases

* Issue #884 - Change (#907)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #884 Done

* #884 Removed Test cases

* #884 change

* Fix#810 (#908)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #810 done

* #810 Reverting Test Cases

* Issue Fix #902 (#909)

* Issue fix #902

* Add migration for allow value nullable in settings table

* Set texttype for value field

* Doc issue fix #84 (#910)

* Issue fix #841 (#911)

* Increase expiry time of tokens from 5 to 20 minutes (#913)

It should still be pretty secure. This allows the app to go easier on
the refreshing, and it makes sure that you can upload large files
without having the token expire halfway through.

* Fix missing ref to 5 min exp

* Issue Fix #863 (#916)

* Issue fix #853 (#918)

* Issue Fix #920 (#922)

* Issue Fix #920

* Issue Fix #920

* Issue fix #879 (#924)

* [thumbnailer] Support for files in subdirectories (#856)

Many websites store images in a complex directory structure. This PR
makes it possible to use thumbnailer in such cases.

For instance :
`/thumbnail/_/100/100/crop/good/complex/path/to/some-image.jpg

* defaults cors.max-age to 600 (#921)

* Bump version

* Fix 943 (#947)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #943

* Fix 717 (#944)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #717

* Fix 576 (#926)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #576 - In progress

* #576 O2M and M20 nested filters

* #576 Fix O2M and M2O nested filters

* get proper string length (#933)

Not tested... I only based this PR on:

Ref: 0fce6a4#commitcomment-33408113

* fixed settings logo (#940)

* added collection/table to InvalidFieldException (#956)

* Fix 931 (#936)

* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #931

* #931

* Issue fix #917 (#960)

* reuse item service instead of using a new instance (#959)

* Issue fix 762 (#961)

* Plain text mail issu resolve (#966)

* Bump version
samvasko pushed a commit to samvasko/api that referenced this issue Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Bug Triage
  
Closed
v2.0.21
  
Done
Development

No branches or pull requests

3 participants