db_prefix attached to the fieldname which caused Unknown column error
| Project: | WeatherFacti -- from a weather.com xml feed |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jonfrancisskydiver |
| Status: | needs review |
Jump to:
Thanks for the module! I have a db_prefix of 'dp62_' on my setting, the module gave me a bunch of "Unknown column of dp62_weather_facti_forecast" errors. I deleted the {} around field_name as following which fixed the problem, but not sure if that's the right approach.
//$sql = "SELECT {weatherfacti_forecast}, {weatherfacti_updated}, {weatherfacti_block_content} FROM {cache_weatherfacti} WHERE {uid} = '%s'";
$sql = "SELECT weatherfacti_forecast, weatherfacti_updated, weatherfacti_block_content FROM {cache_weatherfacti} WHERE uid = '%s'";
It probably should be a separate issue but I get this file-get-contents warning and I'm not very good with PHP, can you help? thanks
warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /homepages/13/d91876083/htdocs/dp62/html/sites/all/modules/weatherfacti/weatherfacti.module on line 291.
Thanks again.
Shanwa

#1
Shanwa, I have posted the fix on drupal's cvs, the development release should be available in about 12 hours. The active release, in green, should be available now for you to download and test out. You should now be able to install this module with your database table prefix. Please keep me updated on the file_get_contents related issue. I may have fixed that issue for you; but I can't be certain because I don't know if your host has enabled cURL functionality. Thank you for reporting this bug to me. Thank you.
#2
thanks for the update, the db_prefix is fine now. and file_get_contents error is also gone for authenticated users, but still a problem for Anonymous users, I thought of user permission and added both access and admin (may not necessary) permission to Anonymous, still the same. you can check my site http://test.80wei.com, you can also sign up if you want, it's just started and not much there anyway :-)
#3
That site address helped out a lot. I have removed the rest of the fopen and file_get_content functions. I think that I've taken care of the rest of the errors for you. If the update goes through with drupal's cvs repository and to the release, you should be able to test these changes.
#4
thanks. just downloaded 6.x-1.6, now it complaints on a foreach syntax
warning: Invalid argument supplied for foreach() in /homepages/13/d91876083/htdocs/dp62/html/sites/all/modules/weatherfacti/weatherfacti.module on line 36
#5
Shanwa, I think that you may have an invalid number in your profile. Please check to see if the number of days to display is set to a value greater than zero. I would uncheck the module, uninstall it, copy the new release, and enable the module. Thank you for your patience in getting this to work.
#6
you're welcome and thanks for your efforts. I checked, the number was set to 3, when I changed it (e.g. to 4 or 5), it rolled back to 3. I then changed it on my admin_user's profile (e.g to 4), it worked, I came back to the system wide profile, it seemed to lock on the number of admin_user (4) again. That was the version 1.6.
I used 1.7 and that number locking issue seems gone, I can change the number independently on users level and system level. But Anonymous users still got that invalid number error.
#7
Can you send me some of the content within the `weatherfacti_forecast` field that is located with in the database table called, `dp62_cache_weatherfacti` (for a few records)?
Also if you're able, try disabling the auto increment for the `uid` field inside the the `dp62_cache_weatherfacti`database table. I just like to see what is going on inside your database.
#8
#9
Shanwa, thank you for emailing me those SQL statements. The content seemed to be encoded and not clear text. Could you send me the clear text version of those SQL statements. I have a few ideas of how to solve the problem; I will work on that and post a patch or a new release soon.
#10
Shanwa, please use this new version; but first make certain to disable the module, uninstall it, overwrite the old module with the new module code, and re enable the module.
Here's the reason why: the database structure for weatherfacti needs to be dumped and regenerated. I hope this will fix the anonymous weather display.
#11
I did it, now even the auth users got that error. after poked around for a while, I found the Postal Code of users (all of them) are set to 47891, which resulted in a 'Invalid location error' on dp62_cache_weatherfacti table. after I changed it to a valid one, it's fine for the users. It looks like that Anonymous user still can not get a valid location even through I tried changed the default location on admin settings to something like 92130:4 or 92130 etc.