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 error when styling points by value in animated aggregation style #14085

Merged
merged 5 commits into from
Jun 19, 2018

Conversation

jesusbotella
Copy link
Contributor

@jesusbotella jesusbotella commented Jun 18, 2018

This PR fixes an error raised when there was a single quote inside a column value when styling points by value in animated aggregation style.

The query sent before was:

select *, (CASE WHEN \"name\" = '' THEN 1 WHEN \"name\" = 'Perfect room in Madrid's Center' THEN 2 WHEN \"name\" = 'Beautiful and bright room in Callao' THEN 3 WHEN \"name\" = 'Cozy room in city center' THEN 4 WHEN \"name\" = 'Apartamento en el centro de Madrid' THEN 5 WHEN \"name\" = 'Beautiful room in Madrid's center' THEN 6 WHEN \"name\" = 'Cozy room' THEN 7 WHEN \"name\" = 'Habitación en el centro de Madrid' THEN 8 WHEN \"name\" = 'Habitación privada' THEN 9 WHEN \"name\" = 'Madrid Center: Puerta del Sol, Tirso de Molina' THEN 10  ELSE 11  END) as value FROM (<%= sql %>) __wrapped

And now the query is:

select *, (CASE WHEN \"name\" = '' THEN 1 WHEN \"name\" = 'Perfect room in Madrid''s Center' THEN 2 WHEN \"name\" = 'Beautiful and bright room in Callao' THEN 3 WHEN \"name\" = 'Cozy room in city center' THEN 4 WHEN \"name\" = 'Apartamento en el centro de Madrid' THEN 5 WHEN \"name\" = 'Beautiful room in Madrid''s center' THEN 6 WHEN \"name\" = 'Cozy room' THEN 7 WHEN \"name\" = 'Habitación en el centro de Madrid' THEN 8 WHEN \"name\" = 'Habitación privada' THEN 9 WHEN \"name\" = 'Madrid Center: Puerta del Sol, Tirso de Molina' THEN 10  ELSE 11  END) as value FROM (<%= sql %>) __wrapped

The modification consists of using double single quotes to escape quotes in the query, as @enekid pointed in #13976 (comment).

Acceptance

See #13976

Related to #13976.

@rubenmoya
Copy link
Contributor

Could you add a test for the new replace please?

@ramiroaznar
Copy link

LGTM!

@jesusbotella jesusbotella merged commit 61dfb98 into master Jun 19, 2018
@jesusbotella jesusbotella deleted the 13976-styling-points-by-value branch June 19, 2018 12:21
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.

3 participants