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

FIX: Sort separator '.' was breaking deep fields, '~' instead #1186

Closed
wants to merge 1 commit into from
Closed

FIX: Sort separator '.' was breaking deep fields, '~' instead #1186

wants to merge 1 commit into from

Conversation

mcd-php
Copy link
Contributor

@mcd-php mcd-php commented Nov 12, 2013

'~' is 1) Not reserved by http://tools.ietf.org/html/rfc3986 2) Does not mix with namespace/class/name separator in any major programming language

'~' is 1) Not reserved by http://tools.ietf.org/html/rfc3986 2) Does not mix with namespace/class/name separator in any major programming language
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.49%) when pulling 411ad98 on mcd-php:fix-sort-separators into 016d796 on yiisoft:master.

@klimov-paul
Copy link
Member

Using “~” symbol in URLs is not recommended, because different URL encode standards processes it in different way:
See http://www.faqs.org/rfcs/rfc1738
See http://www.faqs.org/rfcs/rfc3986

@mcd-php
Copy link
Contributor Author

mcd-php commented Nov 12, 2013

So what instead ? Underscore ? Is popular in field names in snake case. Sub-delims from rfc3986, and tolerate % ?
Use '->' for deep sorting as i do now and '.' for relations, and keep converting both ways ?

@cebe
Copy link
Member

cebe commented Nov 12, 2013

what is the problem with .?

@mcd-php
Copy link
Contributor Author

mcd-php commented Nov 12, 2013

Problem is what i have deep sorting ( by related fields, #1185) and now implementing it into the database layer (CassandraMemSortDataProvider). In DB layer . is used to separate deep nested relations (with(['obPerson.arCertificate'])) and . does not get through Sort object.

Currently i use -> as deep sort delimiter, but two-way conversion will add space for error.

@qiangxue
Copy link
Member

qiangxue commented Feb 6, 2014

How about we use comma , to separate different attributes and : to separate sort direction from attribute name? Yes, both characters are reserved ones, but it seems they are commonly used.

@mcd-php
Copy link
Contributor Author

mcd-php commented Feb 13, 2014

@qiangxue Symbol choice completely up to the team, I ultimately resign in the area of RFC and web practice intricacies.

BTW, do you need the deep ArrayHelper::getValue() ?

@cebe
Copy link
Member

cebe commented Feb 15, 2014

How about we use comma , to separate different attributes and : to separate sort direction from attribute name? Yes, both characters are reserved ones, but it seems they are commonly used.

fine with me.

@qiangxue qiangxue closed this in c0bac44 Feb 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants