-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-18811: Permit spaces in table and column aliases. #8548
Conversation
Spaces are permitted provided the aliases are surrounded by backticks. This is not intended to be a complete representation of what MySQL permits, it's just expanding to permit things that CiviCRM actually generates.
@xurizaemon How can I test this? Through an extension that adds a table with a space? Regex looks fine, and the unit test could be better than my manual testing. Not sure. Let me know. |
Steps to reproduce I believe are -
|
@xurizaemon This in fact fixes the problem at hand, but a few notes I had to remove the form rule for adding locations which was restricting the above reproducibility. Not sure that's completely germane here though.
I setup the location fields as searchable columns on the profile and found a few bugs when searching, again not sure they would be blockers on this. Note that in all of the below I've replaced proper backticks with a single quote for formatting reasons; the backticks are properly set in the queries. Searching by a state_province_id resulted in this WHERE clause.
instead of the the properly formed that includes the under scores
Searching by the city name resulted in a missing location_type_id in the JOIN
instead of
|
Ugh sorry. My instructions in https://issues.civicrm.org/jira/browse/CRM-18811 were better!
I got the feel that there's some confusion internally about the location name vs display name which probably led to this. I didn't dig further at the time. |
I see. With the form rule in place, the listings do work, but those errors on searching within the profile listings still happen. Probably need to sort those bugs out before merging this in. |
Reading the discussion I feel like this should be tagged [WIP] ? |
Seems this PR is not yet ready to be reviewed given the discussion above |
OK - I've marked this WIP & returned to development on the ticket & removed the fix version. Note that I think that PRs that are stalled with no prospect of outstanding issues being resolved in the foreseeable future should be closed & the JIRA used to track the work done. Not sure if this has reached that point yet |
@xurizaemon I just read through this (I was looking for another PR of yours) and I feel that I'm happy to merge it despite the comments above. While the testing showed the format you described appears invalid in other scenarios I would counter that as a blocker on the following basis:
I'm going to push back on the scope creep here & go for merge on pass. @josephlacey did agree this fixes a very narrow definition of the problem and I think we can accept that. |
test this please |
Wow, I'd totally forgotten about this one ... go for it! |
Just confirmed with @xurizaemon he does still think it's worth merging i reviewed this & thought it could merge but I just re-read your comment & you seemed to have backed off it #8548 |
Late to this party, but yeah, merging this seems fine. |
CRM-18811: Permit spaces in table and column aliases.
Spaces are permitted provided the aliases are surrounded by backticks.
This is not intended to be a complete representation of what MySQL permits, it's just expanding to permit things that CiviCRM actually generates.