Comments

andriy_gerasika’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new26.5 KB

Hello,
I want to contribute module marrying Javascript OpenID selector (http://code.google.com/p/openid-selector/) with Drupal's OpenID module.

Benefits of the module are:
1. versus https://www.idselector.com/
my module is open-source and GPL
2. versus http://drupal.org/project/comfortid
IMHO my module's openid login form looks more nice and provides more options, see #3
3. Javascript OpenID selector module is in use at SourceForge (https://sourceforge.net/account/login.php), which proves it is good enough

Demo is available at
http://www.gerixsoft.com/user/login

More details can be found at
http://www.gerixsoft.com/blog/drupal/openid-selector

Source code is attached.

Thank You
Kind Regards,
Andriy Gerasika

sun’s picture

Thanks for your application.

Hm. Why can't you contribute to the existing http://drupal.org/project/comfortid instead and perhaps join forces with that project's maintainer, especially in the long run?

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: +Module review
andriy_gerasika’s picture

Status: Needs work » Needs review

these modules are very different:
ComfortID uses its own Javascript, and implements its own login block,
my module is integrating existing openid-selector javascript from Google Code (same as on SourceForge), and integrates into existing "/user/login" login form
i.e.. I do not reinvent the wheel, ComfortID does

joachim’s picture

Status: Needs review » Needs work

I agree with the applicant's point in #4. ComfortID does its own thing; the proposed module here integrates the external tool from Google code. I don't see they can be usefully merged.

However, some problems with the module code, some minor and some not so minor:

- is there no way this module can work without having to hack Drupal core? I don't know enough about jQuery and the Drupal behaviours system, but can't a behaviour be overridden by a later module?

- merge INSTALL and README into just README, since they're both pretty slim.

- add a file header documentation block

- newline needed at the end of your module file.

- the convention on D6 is a space either side of the . operator.

- openid_selector_form_alter() adds HTML to the output. This should use a theme function.

andriy_gerasika’s picture

StatusFileSize
new29.92 KB

all fixed except:
- openid_selector_form_alter() adds HTML to the output. This should use a theme function.

Is module supposed to use theme_form/render_form from http://drupal.org/node/112358?
Can you please post/point me to an example (URL)?

I guess there will be a conflict if two modules will decide to theme login form

New version is attached below.

andriy_gerasika’s picture

Status: Needs work » Needs review

forgot to change status

andriy_gerasika’s picture

Status: Needs review » Needs work

found two more issues:
a) form alter code produces a warning under strict mode
b) JS file is licensed under BSD

joachim’s picture

> a) form alter code produces a warning under strict mode

What's the warning?

> b) JS file is licensed under BSD

In which case you can't include it. And anyway, it's better not to include external libraries.
Have you looked at http://drupal.org/project/libraries?

njathan’s picture

Subscribing.. looking forward to this module :)

andriy_gerasika’s picture

StatusFileSize
new19.21 KB

a)
User dereine told me on IRC I must wrap $forms[$form_id] access w/ array_key_exists check. done
b)
external Javascript library is required to be unpacked into openid-selector subfolder (i.e. sites/*/modules/openid-selector/openid-selector)

new version is attached.

I am not quite sure about Libraries module:
- major modules like wysiwyg, fckeditor do not use it
- it has an alpha status that has not changed in last 9 monthes; is it stable enough to use it?
- not clear about its future: how will it play w/ Drupal 7 since Drupal 7 introduces some libraries API as well.

though I will release a new version w/ Libraries dependency soon.

sun’s picture

Wysiwyg will use and depend on Libraries API in D7. Libraries API is actually used a lot throughout contrib already. It is not what hook_library() in D7 does. For full details, you may want to read #315100: Allow to add JS/CSS libraries (sets of files, settings, and dependent libraries)

andriy_gerasika’s picture

Status: Needs work » Needs review
StatusFileSize
new11.42 KB

attached is a new version of openid-selector module w/ Libraries module dependency.

njathan’s picture

I tried this module (#13) on Drupal 6.19. While it seems to be working right on Firefox, it does not on Chrome. I am trying to login with google/yahoo account, and upon clicking the Google/yahoo icon, it flashes the error message:

Username field is required.
Password field is required.

Chrome did not redirect me to the respective login pages before throwing that.

edit: Chrome v6.0.408.1 dev
the module version in #6 worked well though

andriy_gerasika’s picture

Status: Needs review » Needs work

thanks, I will fix this bug soon

andriy_gerasika’s picture

Status: Needs work » Needs review
StatusFileSize
new17.01 KB

attached is an updated version fixing "Username field is required. Password field is required." in Chrome.
p.s.
If you have Caching enabled, you may need to reset the cache when upgrading.

joachim’s picture

Status: Needs review » Needs work

I've just tested this and it works great! Very useful addition to Drupal.

A few more points, just small stuff and enhancements:

- copyright notice in several of your files. I can't find anything about this in the CVS application guidelines, but I've a feeling we avoid these (IIRC it causes a legal problem as soon as you get a patch from another person). Could a maintainer comment please?
- I'm not that clued up on JS in Drupal, but it seems to me at least some of the code in your JS file should be using Drupal.behaviors. See http://drupal.org/node/205296 for more.
- ditto the variables such as openid.img_path which you set in the hook_form_alter() -- could they be set on the Drupal object?
- " * Implementation of hook_form_alter : adds OpenID selector to the OpenID form" -- break this into two lines, with a blank line in between. The format for a hook implementation header is:

Implementation of hook_foo().

Does my awesome stuff.

- For clarity, I would lay out the definition of your $forms array on several lines.
- I'd also add a comment above that to explain that the keys are formIDs and the values the HTML ids. Though actually, you could probably just strreplace('_', '-') for the same effect, but I guess whether that makes simpler code is a matter of opinion ;)

Nearly there! :D

avpaderno’s picture

- copyright notice in several of your files. I can't find anything about this in the CVS application guidelines, but I've a feeling we avoid these (IIRC it causes a legal problem as soon as you get a patch from another person). Could a maintainer comment please?

That is what Crell would say. To make a comparison, Drupal core code is copyrighted by every contributor; you will not find a single file that is reported as copyrighted by Dries Buytaert.

andriy_gerasika’s picture

Status: Needs work » Needs review
StatusFileSize
new17.08 KB

all done, except
- I'd also add a comment above that to explain that the keys are formIDs and the values the HTML ids. Though actually, you could probably just strreplace('_', '-') for the same effect, but I guess whether that makes simpler code is a matter of opinion ;)
this will not work for 'user_login_block' => 'user-login-form', array line

joachim’s picture

Status: Needs review » Reviewed & tested by the community

> this will not work for 'user_login_block' => 'user-login-form', array line

Heh, I didn't notice that one ;)

All looks good to me.

I look forward to using this one :)

njathan’s picture

Yes it seems to be working well on google chrome (also) now... waiting to see its own project page :)

michelle’s picture

Status: Reviewed & tested by the community » Fixed

Approved based on joachim's RTBC.

Michelle

andriy_gerasika’s picture

Thanks to everybody, your comments were very helpful :)

Project is now available at
http://drupal.org/project/openid_selector

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.