Closed (won't fix)
Project:
ThemeKey
Version:
7.x-1.x-dev
Component:
Code / API
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
10 Jul 2011 at 22:37 UTC
Updated:
11 Jul 2012 at 12:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
mkalkbrennerI will integrate this.
But I suggest to move the code into ThemeKey itself. There we have a mechanism to dynamically add properties if the module they depend on is installed. In this case there's no need to add something like function_exists().
Just create a file named themekey.wurfl.inc in the modules folder.
Additionally this approach could be ported to ThemeKey 7 later, because ThemeKey Properties has been merged.
Comment #2
mkalkbrenner@chawl:
It would be nice if you find some time to test the attached patch.
Comment #3
mkalkbrennerComment #4
chawl commentedTx mkalkbrenner. In fact my original patch was for Themekey, but I don't want to mess up the core :)
Anyway patch is working ok, but omitting the function_exists wrap breaks the site for the ones who don't have WURFL module.
I'm sure many wurfl options will find their way in ThemeKey, so one day we should put some words about wurfl on ducumentation and alerts also, but for now I suggest your patch to be like this, because I've found no module check in your code :) and sorry if I miss smt.
Comment #5
mkalkbrennerNo, have a look at themekey_scan_modules(). We only load the include files if the corresponding module is installed.
But maybe we should do this to get the code more robust:
Could you please test the code and set the issue to 'reviewed ...' if it works like expected?
BTW it would be great to see more wurfl features to be integrated that way.
Comment #6
chawl commentedOk, first a copy-paste issue. I think this
function themekey_book_themekey_properties()should be this
function themekey_wurfl_themekey_properties()in your code. As I reflexively corrected locally, I forgot to mention.
Yes, last mod is wiser and working perfectly, but there could be a bigger issue with the way the themekey_scan_modules() is called.
If you have enabled contrib module before TK or visit TK admin page after enabling, then everything goes into themekey_modules variable correctly. But if you disable the contrib module alone leaving the TK enabled, themekey_rebuild() is not invoked, variable table is not updated, unsupported inc is loaded erroneously and site breakes immediately with a fatal undefined function php error. As you are out of chance to visit TK admin page or update.php to invoke themekey_rebuild() again, a MySQL operation becomes inevitable.
Can this really be a caching issue or am I missing smt again?
Tx.
Comment #7
mkalkbrennerI committed the new feature to git. Now we need to port it to ThemeKey 7 when WURFL is ported: #1028232: WURFL Drupal 7 Version
@chawl:
You're right with you thoughts regarding the uninstallation of modules. But we should target this in a new issue because it effects all ThemeKey module integrations. For D7 this could easily be achieved by implementing hook_modules_disabled() but for D6 we need a different generic approach. See #1215656: Avoid errors if a third party module gets deactivated
Comment #8
anavarreSubscribe
Comment #9
mkalkbrennersee #1321338: WURFL data is no longer open source
Have a look at the combination ThemeKey / Mobile Tools (https://drupal.org/project/mobile_tools) instead.