Comments

realityloop created an issue. See original summary.

realityloop’s picture

Patch attached

realityloop’s picture

Status: Active » Needs review
StatusFileSize
new2.08 KB

previous patch missing some things, updated patch attached

Status: Needs review » Needs work

The last submitted patch, 3: libraries_support_for_qrcodejs-2807953-3.patch, failed testing.

helmo’s picture

Thanks, this works.
The testbot results look unrelated to this patch.

This will make it easier to add tfa to Aegir ... #2734589: Bundle two factor authentication - tfa

realityloop’s picture

Status: Needs work » Needs review
StatusFileSize
new2.05 KB

removed extraneous library load

Status: Needs review » Needs work

The last submitted patch, 6: libraries_support_for_qrcodejs-2807953-6.patch, failed testing.

helmo’s picture

Status: Needs work » Needs review
StatusFileSize
new2.47 KB

I think we can also drop the

$form['qr_image_wrapper']['qr_image']['#attached']['library'][] = array('tfa_basic', 'qrcodejs');

line... updated patch.

Status: Needs review » Needs work

The last submitted patch, 8: use_libraries_module-2807953-8.patch, failed testing.

helmo’s picture

Status: Needs work » Needs review

re test? The failure seems unrelated to this patch.

helmo’s picture

The last submitted patch, 2: libraries_support_for_qrcodejs-2807953-2.patch, failed testing.

helmo’s picture

helmo’s picture

Status: Needs review » Needs work
helmo’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: use_libraries_module-2807953-8.patch, failed testing.

helmo’s picture

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

It must be the dependency on the libraries module that's breaking the tests. I've updated the testcase to also enable the libraries module.

Status: Needs review » Needs work

The last submitted patch, 17: use_libraries_module-2807953-16.patch, failed testing.

helmo’s picture

Status: Needs work » Needs review

I ran simpletest again on the patch from #17 ... All green.

The only thing I can think of is that the testbot does not fetch the new dependency.

helmo’s picture

It's now added to the Aegir makefile with this patch.

coltrane’s picture

Status: Needs review » Needs work

I think libraries module should be optional so use module_exists('libraries') and don't make an explicit dependency on the module. Otherwise this is cool and thank you for working on it!

nullkernel’s picture

Status: Needs work » Needs review
StatusFileSize
new3.44 KB
new5.17 KB

I've attached an updated patch and an interdiff. Notable changes are:

  1. Libraries module is no longer required (the old installation method still works).
  2. README.txt updated to include instructions for two installation methods.
  3. Additional info in hook_libraries_info().

I had made much of the patch before finding this issue. When I was writing the version number in hook_libraries_info(), I could find no version number for QRCode.js. So I used the project's last commit date as the version number.

In the readme, I made this new way "Option 1", because I don't like the idea of manually adding the library to a subfolder of the tfa_basic module. Users who update this module may lose the library (e.g. using drush pm-update) and not realize that the module has fallen back to sending private keys to Google. It may be worth adding a hook_update_N() or some other means to advise the administrator that there is now a way to permanently add qrcode.js. This kind of goes along with https://www.drupal.org/project/tfa_basic/issues/2809151. Thoughts?

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

#22 seems to be working, thank you.

tapash’s picture

I cant seem to get it working. After applying the #22 patch getting JS error in console ReferenceError: Can't find variable: QRCode. The QR code doesnt show on 2FA setup screen. I have tried placing the qrcode JS both in libreries and includes folder.