question about a code review for the admins here

Events happening in the community are now at Drupal community events on www.drupal.org.
barnettech's picture

I recently did a review of a new module applicant http://drupal.org/node/1379794#comment-5514576 and found that the linkedin module that this person's module depends on doesn't use the library api and the Oauth.php library that it includes isn't namespaced and I cannot even load up this persons module or the module that it depends on (the LinkedIn Module) -- I get lots of "can't load a class twice" type of errors. I don't know if the fact that the module this person is depending has this flaw should hold up his application?

I cannot review his module of course since I cannot even load up the linked in module. Should I just let somebody else review his module? Should this applicant take it upon himself to fix this problem, working with the maintainer of the Linkedin Module?

Actually it may be a larger mess. Perhaps the LinkedIn module should require the Oauth Module, and the Oauth module should be properly using the libraries API module.

Anyhow I didn't want to leave this candidate in "needs work" status unnecessarily, if it truly isn't their problem? It seems the Oauth.php file they require has lots of Class names that conflict across the drupal.org code base.

Thanks

Comments

I took a quick look at the

jthorson's picture

I took a quick look at the OAuth.php library, and it appears that the classes are all properly namespaced ... my first gut reaction would be to check whether you might have OAuth.php installed in two locations within your review environment?

Note that the Linkedin Integration module states for you to 'either' install the OAuth module or download the module from google code ... I missed this on my first quick scan, and probably would have attempted to do both.

still no go

barnettech's picture

So I uninstalled the Oauth module completely, then provided the full path to my downloaded OAuth.php and got a WSOD. The only error I can produce is via drush:

Error: Cannot redeclare class OAuthException in /var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib/linkedin/OAuth.php, line 8

here's my screen dump

barnettech's picture

Here's a screen dump. Just installing oauth module I get a wsod.

jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib$ drush @itmpdev status
Drush command terminated abnormally due to an unrecoverable error.                                                                         [error]
Error: Cannot redeclare class OAuthException in /var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib/oauth/lib/OAuth.php, line 8
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib$ pwd
/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib$ cd ../..
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all$ pwd
/var/www/cfannon_babson_trunk/docroot/sites/all
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all$ cd ../..
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot$ pwd
/var/www/cfannon_babson_trunk/docroot
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot$ pwd
/var/www/cfannon_babson_trunk/docroot
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot$ grep -lr "OAuthException" *
sites/all/modules/contrib/linkedin_group_posts/OAuth.txt
sites/all/modules/contrib/oauth/oauth_common.pages.inc
sites/all/modules/contrib/oauth/lib/OAuth.php
sites/all/modules/contrib/oauth/oauth_common.inc
sites/all/modules/contrib/oauth/includes/DrupalOAuthToken.inc
sites/all/modules/contrib/oauth/includes/DrupalOAuthDataStore.inc
sites/all/modules/contrib/oauth/includes/OAuthSignatureMethod_HMAC.inc
sites/all/modules/contrib/oauth/includes/DrupalOAuthConsumer.inc

I'm not sure where it's redeclaring OAuthException a 2nd time. For a code review this is digging pretty deep I feel, and beyond what I've done here it's the applicants responsibility? But of course I opened this thread in case I'm missing something.

2nd test

barnettech's picture

Ok now I tested it with oauth module uninstalled and the oauth module directory completely deleted. Then I put OAuth.php in the applicants directory, and point to it in the linkedin config page. Again WSOD.

Again the only clue is when I go to use drush, here is my screen dump:

jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib/linkedin_group_posts$ drush @itmpdev status
Drush command terminated abnormally due to an unrecoverable error.                                                                         [error]
Error: Cannot redeclare class OAuthException in
/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib/linkedin_group_posts/OAuth.php, line 8
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot/sites/all/modules/contrib/linkedin_group_posts$ cd /var/www/cfannon_babson_trunk/docroot
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot$ grep -lr "OAuthException" *
sites/all/modules/contrib/linkedin_group_posts/OAuth.php
jbarnett@drupaltest3:/var/www/cfannon_babson_trunk/docroot$

after a quick google search

barnettech's picture

A quick google search only revealed: http://drupal.org/node/1134444 in the drupal 6 version autoload problems were causing WSOD with OAuth module.

Code review for security advisory coverage applications

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: