Reviewed & tested by the community
Project:
Feeds SQL
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2012 at 13:52 UTC
Updated:
23 May 2017 at 17:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rmathew commentedIt's the field names in the SQL query that matter - if you have any uppercase character in the field name then no result will be returned for that field.
Fortunately there is a workaround, at least with mysql - simply use lowercase in the SQL query under /import/[importername]. For example, if you have:
Fails : select * from tblname
Fails : select ID, Name from tblname
Works : select id, name from tblname
Comment #2
mortona2k commentedYup, I'm seeing the same.
Comment #3
adanbouzoua commentedI'm getting the same error trying to import from MS SQL 2008 .
I spent days identifying the error because setting ID (uppercase) as "Unique Target" failed.
But work when field name are in lower case
Comment #4
stevenx commentedI looked trough the Feeds SQL module but could not find where it crashes.
I confirm the error as mentioned in #1
Might be in the Feeds module itself somewhere?
Comment #5
Outdoor Ed commentedThis is especially confusing since in the SQL Query Parser if you enter Uppercase or Mixed Case the query runs and shows you the sample records to be imported. Then when you actually run the importer nothing comes across (at least from SQL Server). There should be specific documentation talking about this.
Comment #6
jrandell commentedOMFG!!!
three days on this, and all it took was lowercase!
Dear Mr. Maintainer,
While I am a bit irritated, your horse is still a lovely gift. Even if it took a great deal of effort to fix the mouth, I am grateful to you!
Comment #7
mpotter commentedThis also caused a problem for me. Could not figure out why I was getting "Term name missing" when trying to import taxonomy terms. The column was uppercase and using the comment from #1 fixed it.
Comment #8
Johann Wagner commentedI think this special case must be made public.
I think of a warning message on this project page or on the pre-fetcher page.
On this pre-fetch results page, uppercase columns are still shown and results are correct.
Thank you.
Comment #9
nattyweb commentedOh for goodness' sake. I have spent HOURS over many days on trying to debug my import and all that was at fault was the case of the fields in my import table.
Thanks to all for documenting this 'feature', especially to those posting recently so I knew this was still a current issue.
Comment #10
LGLC commentedThis can be extremely frustrating, especially as there are no error messages to indicate anything is going wrong. I've written a patch to force the Fetcher to convert any query to lowercase, as suggested in [#1631014]. You may need to clear your cache after applying the patch.
The other option would be to stop the Parser converting the elements to lowercase (i.e. deleting the
getSourceElement()override from FeedsSQLParser.inc), but I wasn't sure if that would have any other unintended consequences, so this seemed the safest way to go.Comment #11
LGLC commentedWhoops, forgot to use the new FeedsSQLFetcherResult. New patch attached.
Comment #12
eabquina commentedThis solved my issue. It was just that all along!
Comment #13
Raher commentedI lost hours on this problem! Thank you
Comment #14
alibama commentedfixed my import... RTBC?
Comment #15
kekkisIt doesn't fix for example feeds_tamper's 'Blank source' case.
I suggest we still explore removing the override of
FeedsParser::getSourceElementas per [#1631014]. What is the harm this may cause? Or better, why was the override added in the first place? Anyway, attaching the patch for others to test.Comment #16
darren ohRemoving the override works. The override was copied from the FeedsCSVParser class. It is causing problems because the FeedsSQLParser class is not an instance of FeedsCSVParser. There is no harm in removing it.
Comment #17
fool2 commentedCan someone please please please commit this? It is insane how many hours this is wasting still and it was solved months ago!
I am going to describe the problem I was having here, in hopes that someone will find this patch when googling-- my node import using feeds_sql was succeeding but I was losing some fields--I was getting blank fields from the import even though they showed fine in feeds_import_preview! I stumbled on this issue before noticing that it was only the fields that had column names with capital letters in them.
Patch applies wonderfully, and this module is awesome otherwise.
Comment #18
fool2 commentedI have been thinking about this more, and I am thinking that maybe we should use PDO::CASE_LOWER to solve this instead.
http://php.net/manual/en/pdo.setattribute.php
This will force all columns coming out of this to be lowercase. It shouldn't affect any other database connections-- if it does we need to make sure not to leave the attribute set after the process has completed. I am noticing some other modules (feeds_profile2) having problems with case as well, probably due to the output of this module, so this patch isn't a full solution because of how other modules might be treating the data.
Comment #19
anybodyI can confirm this issue still exists and the patch solves it. Could you create a new release containing this fix?