Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Main issue for CAPTCHA's Drupal 8 migration.
Please submit pull-requests to https://github.com/chuva-inc/captcha/tree/8.x-1.x
Comment | File | Size | Author |
---|---|---|---|
#70 | CAPTCHA-Drupal_8_port-1949682-70.patch | 11.06 KB | str8 |
#1 | CAPTCHA-Drupal_8_upgrade-1.patch | 2.3 KB | darrell_ulm |
#4 | CAPTCHA-Drupal_8_upgrade-1-do-not-test.patch | 2.3 KB | darrell_ulm |
#6 | CAPTCHA-Drupal_8_upgrade-2-do-not-test.patch | 50.62 KB | elachlan |
#7 | CAPTCHA-Drupal_8_upgrade-3-do-not-test.patch | 50.96 KB | elachlan |
Comments
Comment #1
darrell_ulm CreditAttribution: darrell_ulm commentedAttached is the patch to upgrade the module to Drupal 8.
Cheers,
Comment #3
darrell_ulm CreditAttribution: darrell_ulm commentedThe patch applies fine. This could be because there is no Drupal 8 branch to apply the scripts/run-tests.sh which is now at core/scripts/run-tests.sh.
Seems like it should run under 8.x-1.x test
ref: http://drupal.org/node/332678
Adding do-not-test flag.
Of course we're all learning the D8 stuff as the docs are worked out.
Comment #4
darrell_ulm CreditAttribution: darrell_ulm commentedand the patch again renamed.
Comment #5
elachlan CreditAttribution: elachlan commentedHere is a guide on converting a module.
https://drupal.org/node/1911346
I am working on it at the moment. It would be nice to have a 8.x dev branch to work against.
Comment #6
elachlan CreditAttribution: elachlan commentedAll changes #4 made.
I have changed the info files on both captcha and image_captcha.
I also separated out the test files and placed them in the lib folder structure as per the guide.
I changed the .inc files and .module files to use t() instead of get_t.
The administration page seems to load but there is a problem with line 194 in captcha.inc.
$language = language(LANGUAGE_TYPE_INTERFACE);
This is in relation to this change: https://drupal.org/node/1450578
I have not made sense of it so far, I think it we have to use a service some how (see https://drupal.org/node/1539454).
Alternatively we could move towards using the controllers, which seems like a more segmented and proper approach.
Comment #7
elachlan CreditAttribution: elachlan commentedMade change for this issue.
https://drupal.org/node/1969794
Now examples work.
Comment #8
elachlan CreditAttribution: elachlan commentedPatch excluded some unversioned files..fixed.
Comment #9
elachlan CreditAttribution: elachlan commentedI talked to some people on IRC and through that I udpated the documentation with regards to https://drupal.org/node/1450578
I have changed the code accordingly.
It is now:
$language = Drupal::languageManager()->getLanguage();
Comment #10
elachlan CreditAttribution: elachlan commentedChanging title for better dashboard access.
Comment #11
wundo CreditAttribution: wundo commentedCAPTCHA 8.x-1.x branch created! ;)
Comment #12
wundo CreditAttribution: wundo commentedComment #13
wundo CreditAttribution: wundo commentedComment #14
wundo CreditAttribution: wundo commentedRe uploading the patch from #9 to trigger the testing.
Comment #15
elachlan CreditAttribution: elachlan commentedFixed missing warning image on admin/config/development/performance.
Currently the tests won't run, not sure on the cause. Believe its the branch failing testing.
See: https://qa.drupal.org/pifr/test/552048
Comment #16
elachlan CreditAttribution: elachlan commentedCurrently getting this error:
Notice: Undefined index: id in theme_fieldset() (line 2870 of core\includes\form.inc).
To recreate:
enable captcha for:
user_login
user_login_block
user_pass
user_register_form
Then view the login page and click between the tabs.
Comment #17
elachlan CreditAttribution: elachlan commentedFinal change for tonight.
Fixed some stuff to do with CaptchaBaseWebTestCase.
Comment #18
elachlan CreditAttribution: elachlan commentedMore changes to tests.
646 passes, 114 fails, 104 exceptions, and 151 debug messages
Comment #19
elachlan CreditAttribution: elachlan commentedBecause of Drupal 8 being HTML 5 I have removed the javascript added from this issue: https://drupal.org/node/881156
I am currently working to find a way to use something similar to the html details element, but constantly open. Currently If I set it to open, it doesn't work. I think it might be a bug in core.
Also firefox does not support html 5 as of yet.
Comment #20
elachlan CreditAttribution: elachlan commented646 passes, 114 fails, 93 exceptions, and 151 debug messages
Getting better! Managed to get the captcha working on the user_login as it was renamed to user_login_form hence the changes to the install.
There is a hack for the details element at the moment, as the #open doesn't work on it. So I added it as an attribute.
Comment #21
elachlan CreditAttribution: elachlan commentedThis should remove the exceptions. Will do a proper test tomorrow morning.
Comment #22
elachlan CreditAttribution: elachlan commented710 passes, 14 fails, 0 exceptions, and 172 debug messages
Even better, but I am stuck with the
testMultipleCaptchaProtectedFormsOnOnePage()
test in CaptchaSessionReuseAttachTestCase.phpI believe
allowCommentPostingForAnonymousVisitors()
fails and causes the issues.Comment #23
elachlan CreditAttribution: elachlan commented705 passes, 0 fails, 0 exceptions, and 169 debug messages
Done for the core CAPTCHA module!!
Image CAPTCHA does not currently work, but shouldn't be as much of a hassle (famous last words).
Comment #24
elachlan CreditAttribution: elachlan commentedThe structure of Image CAPTCHA kind of requires us to move to use the new forms system. So this is going to take a while.
Its worth the change though, because it brings all the different pages into form classes.
see: https://drupal.org/node/1800686 for more info on it.
I anticipated this and created an issue before #2024895: Move hook_menu() calls to routing system I will probably keep working here for now. Because CAPTCHA is already working, I will focus on image captcha. After both are working I will move CAPTCHA over to forms.
Comment #25
elachlan CreditAttribution: elachlan commented705 passes, 0 fails, 0 exceptions, and 169 debug messages
Image CAPTCHA is done and moved to routing system for the administration. Both MENU_CALLBACKS will have to be migrated. I think to controllers instead of forms.
CAPTCHA has had the administration moved to routing system, except for the examples. I am unsure how /module/challenge is going to work.
Lots of the logic has been moved out of the admin.inc files.
This should be good to commit to the branch.
Comment #26
geerlingguy CreditAttribution: geerlingguy commentedA couple quick suggestions (to make D8 and CAPTCHA rock harder!):
Many (if not most) of the people using Honeypot also have CAPTCHA installed, and I think it'd be awesome if both modules were ready to go on D8's launch day. It took a really long time for any good (and stable) spam prevention modules to be released for D7. Let's not make that mistake again!
Comment #27
elachlan CreditAttribution: elachlan commentedI'm not really the Dev on this. Just some guy doing my thing to help out. I agree with #D8CX, but that is a maintainers pledge. Not really something for us to decide on.
Does the patch work for you? I would love some feedback/patch reviews.
Comment #28
wundo CreditAttribution: wundo commentedLooks like #23 adds some whitespace issues:
Either way that one was applied to 8.x-1.x :)
Comment #29
wundo CreditAttribution: wundo commentedThe changes from #25 were also committed!
Comment #30
wundo CreditAttribution: wundo commentedBtw, I've just committed a fix for the whitespaces on 8.x branch, it would be great if you reroll before writing the next patches (or --rebase your repository).
Comment #31
elachlan CreditAttribution: elachlan commentedThanks Wundo!
#25 is the latest. It fixes a few issues.
Sorry about the whitespace!
I will rebase/re-write in the next 24hrs.
Comment #32
elachlan CreditAttribution: elachlan commentedBranch passed testing! :)
Next up will be moving more logic out of captcha.admin.inc into either controllers or forms.
Both of the last items from hook menu need to be moved and routes added:
Same for image captcha:
Then we can then see about moving the user logic to controllers.
Finally we will move to the configuration system. Which will neaten up the code a bit.
Comment #33
wundo CreditAttribution: wundo commentedAdded 8.x branch releases to the project home page!
Comment #34
elachlan CreditAttribution: elachlan commented@Wundo - Could I please be a maintainer for 8.x branch?
Comment #35
wundo CreditAttribution: wundo commentedSure, that would be a honor ;)
Comment #36
wundo CreditAttribution: wundo commentedDone!
Comment #37
elachlan CreditAttribution: elachlan commentedThanks!! :)
Comment #38
m1r1k CreditAttribution: m1r1k commentedLets continue maintain 8.x branch :)
Apply new configuration API
Comment #39
m1r1k CreditAttribution: m1r1k commentedApply Library API according to https://www.drupal.org/node/2169605 and https://www.drupal.org/node/2201089
Comment #40
m1r1k CreditAttribution: m1r1k commentedImplement PSR-4, fix routing and forms api.
Comment #41
podaroktest bot
Comment #43
m1r1k CreditAttribution: m1r1k commentedContains sniffer clean up, test fixes, image_captcha module port and lots of other stuff.
Comment #45
m1r1k CreditAttribution: m1r1k commentedI've rewritten image generation controller using Symfony StreamedResponse class. Now image_captcha works nice and "pretty ready" to be used.
Comment #46
m1r1k CreditAttribution: m1r1k commentedComment #48
m1r1k CreditAttribution: m1r1k commentedLast fixes and diabling AdminTest because it needs full rewrite.
Comment #50
m1r1k CreditAttribution: m1r1k commentedReroll
Comment #52
m1r1k CreditAttribution: m1r1k commentedReverted minor changes in font binaries. Interdiff.txt is the same.
Comment #54
m1r1k CreditAttribution: m1r1k commentedanother reroll
Comment #56
jeqqAdd missing method and other fixes.
Comment #57
jeqqComment #59
m1r1k CreditAttribution: m1r1k commentedLets move development to GitHub repo to make it easier and more flexible.
https://github.com/M1r1k/captcha
Comment #61
wundo CreditAttribution: wundo commentedComment #62
vladan.me CreditAttribution: vladan.me commentedLatest changes are merged in github repo
Comment #63
elachlan CreditAttribution: elachlan commentedLinking related issue
EDIT:
Merged into drupal git. This should help fix #2353977: Fatal error on installation.
Comment #64
elachlan CreditAttribution: elachlan commentedIs it possible to get a dev release so that we can tag issues? It would make the meta game a little easier. It might also get more people involved.
Comment #65
wundo CreditAttribution: wundo commentedThere is already a dev release ;) 8.x-1.x-dev
Comment #66
m1r1k CreditAttribution: m1r1k commentedMaster branch on github has more the less workable version. Be aware of the image_captcha doesn't work with custom fonts (don't know why). You can check it on https://drupal.com/contact.
However I will merge plugin style rewrite soon that will have new image captcha generator lib, plugin system, per form settings and may be even test coverage :)
Comment #67
wundo CreditAttribution: wundo commentedm1r1k if you're using github please send me a pull request ;)
tks
Comment #68
elachlan CreditAttribution: elachlan commentedSorry Wundo! I posted it on the wrong issue!
The merged fixed an issue, so I just went ahead and did it.
Comment #69
str8 CreditAttribution: str8 commentedComment #70
str8 CreditAttribution: str8 commentedhi, we have replaced old l() and url() functions with new methods. And created tab for image_captcha in module settings.
Comment #71
wundo CreditAttribution: wundo commentedThanks for the patch, I'd love to have a small summary from the changes you made... ;)
Comment #72
BerdirI'd suggest to close this issue. There's an 8.x-1.x branch, everything that has been worked on has been committed to that a long time ago.
The port is not complete, there are known issues, but we can track that with separate issues.
Comment #73
elachlan CreditAttribution: elachlan commentedThanks Berdir!