Closed (fixed)
Project:
Who Bought What|Ubercart
Version:
6.x-2.11
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
30 Jul 2010 at 15:18 UTC
Updated:
5 Sep 2012 at 20:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
cayenne commentedSo, if I understand correctly, PGsql does not like field names that have uppercase, or it automatically downcases them?
Okay, if so, that should be a simple change, with the primary issue being preserving column LABELS, which should have been stored separately anyway. Have you tested your solution on attribute names as well?
Comment #2
john franklin commented[dup deleted.]
Comment #3
john franklin commentedI'm not sure what you mean by "attribute names."
The patch attached is all I tested. It contains all necessary and sufficient changes to get my site to work.
The patch preserves mixed-case column header labels in the HTML output while being able to pull the data out of the hash with all lower-case keys returned from the SQL call. PgSQL seems to automatically downcase them. (I saw them downcased using the CLI psql tool as well.)
Comment #4
john franklin commentedRe-rolled patch for 2.11.
Comment #5
cayenne commentedGreat!
Following the weekend I will roll all these in.
Comment #6
cayenne commentedErrr, the patch breaks mySQL version. More work to do.
Basically, we want to take field names to lower case, right?
What is the deal with the date reformatting?
Comment #7
john franklin commentedYes, downcase all the fields. PostgreSQL will return an array with all downcased keys even if you ask for field names in mixed case. that is "SELECT Foo AS BarBaz" will return
$result['barbaz'], not$result['BarBaz']Regarding the time formatting, there is no such thing as FROM_UNIXTIME in PostgreSQL. It shouldn't be reformatting the time, just the SQL to select it based on DB.
Comment #8
cayenne commentedGot it. I believe I got them all in the latest dev. Try it in about ten minutes. Also, time formatting is now done after the fact in PHP rather than in SQL. I suspect that this will make it not care about mySQL vs Postgre
Comment #9
john franklin commentedYes, doing the date formatting in PHP does remove the issue.
Functionally, the patch committed mostly works. However, there is some code cleanup that can be done:
$dateformatis set twice, but never usedComment #10
john franklin commentedI'd also suggest the date field use the Drupal function
format_date()instead ofstrftime().Comment #11
cayenne commentedAh did not know about format_date(). I'll review your notes, commit, tag and update rev.
Thanks so much, John.
Next step: convert to D7!
Comment #12
cayenne commentedOkay, I found the camelcase problems with the field titles. Old habits die hard.
As to the strftime vs format_date question, I put that in the way I did to get around the problem that the report was not sorting correctly by date per another bug report. Source code and my testing shows that using date_format reintroduces the problem.
I fixed the case on checkOutNode, but will need to figure out why I had it in there.
Comment #13
cayenne commentedPosted as .12
Comment #14
john franklin commentedLooks good! Thanks.
Comment #15
liam morlandTagging