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.
Right now Image CAPTCHA settings form has lots of errors, also menu tasks are not defined.
Comment | File | Size | Author |
---|
Issue fork captcha-2501699
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
m1r1k CreditAttribution: m1r1k at Propeople (now part of FFW) for Propeople (now part of FFW) commentedComment #2
m1r1k CreditAttribution: m1r1k at Propeople (now part of FFW) for Propeople (now part of FFW) commentedAnd now with required files :)
Comment #3
BerdirYou don't need both a menu link and a local task, IMHO, just a local task should be enough.
Comment #8
elachlan CreditAttribution: elachlan commentedCould you re-roll the patch with only the local task?
Comment #9
BerdirComment #10
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedI have updated the patch.
Comment #11
BerdirThis is not the same, the old call was about checking if there are languages that do RTL, this will never be TRUE now.
You shouldn't create a new request, just have it injected by adding Request $request to the buildForm() method.
Comment #12
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedOK, I have updated the patch and added more modifications. Currently page works correctly.
Comment #13
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedComment #15
naveenvalechaComment #16
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedTest again.
Comment #17
ddrozdik CreditAttribution: ddrozdik as a volunteer commentedComment #18
naveenvalechasame here inject the @language_manager service.
Please inject the @kernel service.
same as above. please inject the @kernel service
Edit : oops please ignore 2,3 those are static methods so no need to inject the service.
Comment #19
ddrozdik CreditAttribution: ddrozdik as a volunteer commented@naveenvalecha your are right. I have update the patch.
Comment #20
naveenvalechaComment #21
hass CreditAttribution: hass commentedThis should be a render array (the upgrade path from theme_image()
render array
Since Drupal 7 we should not use md5 - use sha2 only.
Comment #22
ddrozdik CreditAttribution: ddrozdik as a volunteer commenteditem #3 will be fixed in this issue https://www.drupal.org/node/2486113
Comment #23
elachlan CreditAttribution: elachlan commentedCould you re-roll the patch with the fixes please?
Comment #24
naveenvalechaStraight reroll after #2486113: Replace md5 with sha256 hashes
Comment #26
elachlan CreditAttribution: elachlan commentedComment #28
Utilvideo CreditAttribution: Utilvideo commentedError
Drupal\Core\Config\UnsupportedDataTypeConfigException: Invalid data type for config element image_captcha.settings:image_captcha_fonts_preview_map_cache.3438abc85ac58eaab01cd741b1c3f9bb5dd3b9be3c079b1a7851884135608b2f in Drupal\Core\Config\StorableConfigBase->validateValue() (line 160
Comment #29
Utilvideo CreditAttribution: Utilvideo commentedProblem is in this method
$form['image_captcha_font_settings'] = $this->settingsDotSection();
Comment #30
harald_ CreditAttribution: harald_ commentedHi, that is unfortunately not fixed. Please reopen this issue.
The settings page cannot be accessed via the backend, the error message appears as described by Regnoy.
Comment #31
Anybody@Maintainer, @Regnoy & harald_ have you tried the latest dev? Does the problem still exist there?
If everything is OK in dev, lets please create a new stable release
If it's not OK, could the maintainer please re-open the issue?
Comment #32
Anybody@elachlan / Maintainer: I just checked this myself. The current dev does not work, the image captcha settings form does not appear in the navigation / tabs. We'll need a follow-up patch. Please re-open this issue to have the still existing problem / context.
Comment #33
AnybodyAs temporary workaround you can set the values using devel config editor: /devel/config/image_captcha
Comment #34
elachlan CreditAttribution: elachlan commentedComment #35
couturier CreditAttribution: couturier as a volunteer commentedComment #36
yogeshchaugule8 CreditAttribution: yogeshchaugule8 commentedI've created a patch by using existing available configurations. Following issues are updated in patch :
Comment #37
jernejbeg CreditAttribution: jernejbeg at Agiledrop - Your Trusted Drupal Teammates commentedPatch fix_image_captcha_settings-2501699-36.patch does not apply. Marking this as Needs work.
Comment #38
rpayanmComment #39
rpayanmComment #40
AnybodyHi @rpayanm - could you please provide an interdiff? You posted a patch without any comment, so we can't understand, what changed. Thank you!
Comment #41
AnybodyI tried the patch in #38 and found the following issues:
on the settings page.
Anyway I can confirm that the patch works and creates a configuration page, which is much better than none... but the 1st and 2nd point should be fixed first to prevent broken captcha.
I'd vote for a first "working" solution and follow-up improvements to at least have the Drupal 7 status.
Thank you all very much!
Comment #42
rahulrasgon CreditAttribution: rahulrasgon at QED42 commentedComment #43
rahulrasgon CreditAttribution: rahulrasgon at QED42 commentedPlease review the patch.
Following issues are updated in patch :
image_captcha_fonts
stores the file path in the config, and on form we are rendering the hash value as options.This warning was due to incorrect library name used.
Thanks
Comment #44
AnybodyWhao @rahulrasgon GREAT work!
Fixes the mentioned problems in #41.
One thing I didn't see before is the part of the patches from #36 on, which remove the protected method and replace them by a functional function. I can't see a good reason for that in Drupal 8 / 9 and it should be reverted.
Thanks a lot for your effort! Really looking forward to this!
Perhaps we can soon have maintainer feedback on this? @elachlan?
Comment #45
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedComment #46
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedSorry now I am busy some other task will resume later.
Comment #47
Inaetaru CreditAttribution: Inaetaru commentedI'm sorry, but #43 breaks compatibility with Drupal 9. It uses
file_scan_directory
in_image_captcha_get_available_fonts_from_directories
(instead of original$this->fileSystem->scanDirectory
ingetAvailableFontsFromDirectories
), but the method is deprecated in Drupal 8 and removed in Drupal 9.Anyway, thanks a lot for all your work!
Comment #48
BerdirComment #49
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commented@berdir as per #47 have replace depreciated function and creating a new patch for D9.
Comment #50
sanjayk CreditAttribution: sanjayk as a volunteer and at Srijan | A Material+ Company for Drupal India Association commented@Berdir Please ignore #49 patch. I have fixed the and uploading new patch and interdiff.
Comment #51
jernejmramor CreditAttribution: jernejmramor at Agiledrop - Your Trusted Drupal Teammates commentedI have tested this and the patch in #50 is working for me.
Comment #52
AnybodyUsing #50 for nearly three months now and it adds back the important image captcha form missing since 7.x so I'd definitely vote to finally review and commit it.
One could discuss to put _image_captcha_get_font_uri into a class or similar but let's be honest, this is now missing since years at all, situation won't get worse ;)
Comment #53
nmatja CreditAttribution: nmatja at Agiledrop - Your Trusted Drupal Teammates commentedI have tested the fork update. Listed updates are working for me.
Comment #54
AnybodyRTBC for the reasons given in #52. Anyway there's still space for improvement and additional tests, if someone would like to take that little but important project. :)
Any Captcha maintainer in this issue to finalize RTBC and commit this?
Thank you all!
Comment #55
japerry50 looked good to me as well. Committed!
Comment #57
AnybodyWhao this is important news after years without proper configuration for Captcha image!
We should now focus on improvements and tests for that functionality as follow-up. Thank you very very much for commiting this @japerry!