Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom values (location_type, tenure_type) cannot have more than 10 chars - Error should be raised when uploading the xlsform questionnaire #1575

Closed
SteadyCadence opened this issue Jun 9, 2017 · 9 comments · Fixed by #1851

Comments

@SteadyCadence
Copy link

I changed the values of the party_type to be 'owner' or 'representative' and on the web it shows up as individual.

Also, on the API it doesnt allow me to change the value. Error: {"type":["\"owner\" is not a valid choice."]}

@wonderchook
Copy link
Contributor

@SteadyCadence that is working as designed. You only can have custom types for relationships and locations right now. It is because the UI is more complex for parties

@SteadyCadence
Copy link
Author

I am getting an error for tenure_type as well. It says: "{"tenure_type":["Ensure this field has no more than 10 characters."]}"

@dpalomino
Copy link

So as commented, party_type was not included in this feature.

I've been doing a quick test with this project and I've seen that the problem appears when in the questionnaire a new choice for either location_type or tenure_type is including with the name containing more than 10 characters.

The issue appears when trying to create a new location or relationship selecting this more than 10 chars type (but the questionnaire is accepted and the project created).

See screenshot:
screen shot 2017-06-12 at 11 48 13

In this case I was using the location_type name "Miscellaneous" (more than 10 chars).

Is there any reason to limit this to then 10 chars @oliverroick. If it is we just need to document it.

@dpalomino dpalomino changed the title Custom values not working for party_type Custom values (location_type, tenure_type) not working for choices names longer than 10 chars Jun 12, 2017
@dpalomino
Copy link

Updating the title to be more explanatory.

@dpalomino
Copy link

Copying a relevant comment from @SteadyCadence:

The abbreviations don't work well when you are using the QGIS plugin. Right now it only pulls down the "keys"/names of the fields. I guess that is the root of the problem--> QGIS only using the names of the fields and not the labels.

@oliverroick
Copy link
Member

I think this is something we should handle on the QGIS side. The reason for allowing only 10 characters for the keys is that the key should be short; they are the values we store with each of the entities. It would be possible to allow more characters, but it's against best practices to do so.

@dpalomino dpalomino changed the title Custom values (location_type, tenure_type) not working for choices names longer than 10 chars Custom values (location_type, tenure_type) not working for choices names longer than 10 chars - Jul 3, 2017
@dpalomino dpalomino changed the title Custom values (location_type, tenure_type) not working for choices names longer than 10 chars - Custom values (location_type, tenure_type) cannot have more than 10 chars - Error should be raised when uploading the xlsform questionnaire Jul 3, 2017
@dpalomino
Copy link

Ok, I think we will need then only to check in the parser that location_type and tenure_type names in the xlsform file are less than 10 chars when uploading the questionnaire. Right now choices for location_type and tenure_type greater than 10 chars are accepted and the error occurs when trying to add a new location or relationship using that key.

Changing the subject to be more descriptive.

@SteadyCadence
Copy link
Author

On staging, I was able to upload a questionnaire successfully (normally I get an error about the length of the characters if the names are longer than 10 characters during the questionnaire upload phase); however, when I go to add a location I then get an error about the length of the name (key).

screen shot 2017-10-06 at 2 32 05 pm

The error should not be occuring when you add a location. It should happen with you upload the questionnaire. That is what happens on demo and platform.

@SteadyCadence
Copy link
Author

Ideal solution would be to remove the 10 character limit... but second solution is to make sure error handling occurs at questionnaire upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants