I'm not quite sure what causes the following error to appear - something to do with what happens when we mirror our site onto a backup where WURFL is not fully installed.

Fatal error: Call to a member function getDeviceForHttpRequest() on a non-object in /home/kalaam/www.kalaam.org/sites/all/modules/wurfl/wurfl.module on line 102

In order to eliminate both that error and the subsequent error (below) and fail more gracefully, I've added a simple check that the object in question does exist. If it does not, the functions just return nothing.

Fatal error: Call to a member function getCapability() on a non-object in /home/kalaam/www.kalaam.org/sites/all/modules/wurfl/wurfl.module on line 153

CommentFileSizeAuthor
#2 wurfl.module.941774.patch1.09 KBmartin_q

Comments

martin_q’s picture

Status: Active » Needs review

Patch with bug fix attached.

martin_q’s picture

StatusFileSize
new1.09 KB

Patch with bug fix now attached (I hope).

twom’s picture

Thx for the patch. However is WURFL working?

This problem can occur if you enable device detection with WURFL when WURFL is not installed correctly.

I have added a range of checks, but maybe not enough;
Check the following:
- wurfl lib in your libraries folder
- the resource folder has the wurfl.xml and wurfl-config.xml
- cache folder in your wurfl lib folder is writable

Thx,
Tom

martin_q’s picture

Hi,
No, as mentioned in my initial post, this is for situations where WURFL is not correctly installed. My patch is there to help with more graceful degradation.
Thanks,
Martin

vip_sa’s picture

I just get this error on my localhost so will this patch work or not?

the error:
Call to a member function getDeviceForHttpRequest() on a non-object in C:\wamp\www\mobile\sites\all\modules\wurfl\wurfl.module on line 101

martin_q’s picture

You can try it - it's a very similar error, so worth a try. However, this won't fix WURFL for you. All the patch does is stop the WURFL problem from bringing your whole site down.

j4’s picture

Hi,

Do the resources and cache folders have to be inside the wurfl folder or in thesame level as the wurfl folder? either way i am getting the please create ... message on the admin/settings/wurfl page. Can you help me please?

Thanks
Jaya