Problem/Motivation

The MonitoringCaptchaTest is failing: https://www.drupal.org/pift-ci-job/480869

Proposed resolution

Debug, find the bug and fix the test

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ginovski created an issue. See original summary.

Berdir’s picture

This could be a core issue, facets also has that I think.

Berdir’s picture

Project: Monitoring » CAPTCHA
  foreach ($form_ids as $form_id) {
    $values = [
      'formId' => $form_id,
      'captchaType' => 'default',
      'status' => FALSE,
    ];
    $captcha_point = new CaptchaPoint($values, 'captcha_point');
    $captcha_point->trustData()->save();
  }

This is wrong.

Must use $storage->create().

Ginovski’s picture

Status: Active » Needs review
FileSize
543 bytes

1. Changed creating captcha point with storage instead.

ddrozdik’s picture

Status: Needs review » Reviewed & tested by the community

Looks correct.

naveenvalecha’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
282 bytes

Thanks committed and pushed to 8.x-1.x
Also removed the unused statement at commit.See in the interdiff attached

Berdir’s picture

Didn't get to review.

We could get the storage out of the loop as a tiny improvement.

Also, the current logic will break trying to install captcha as part of a config deployment. The hardcoded form ids could be just default configuration in the module. the dynamic node type based ones are a bit tricky, we could either remove them or at least check for a sync, see forum_install().

And the drupal_set_message()'s there are IMHO also a bad idea. The second one is broken anyway (page cache is a module now, not a setting) and the first is weird when installing it in a config sync or install profile. Other modules don't do this either, the modules page has links to settings and help built-in.

  • naveenvalecha committed fcd3f60 on 8.x-1.x
    Revert "Issue #2808087 by Ginovski, naveenvalecha: MonitoringCaptchaTest...
naveenvalecha’s picture

Status: Fixed » Needs work

Reverting this for now to get this fixed in appropriate way as per #8. Config sync would be right improvement to fix the config deployment.

Ginovski’s picture

Assigned: Unassigned » Ginovski
Status: Needs work » Needs review
FileSize
3.81 KB
3.78 KB

1. Moved storage out of the foreach loop
2. Removed hardcoded form_ids, now they are default config in the install folder.
3. Added check for a sync for the dynamic forms
4. Created a followup for the messages #2811777: Remove drupal_set_message's from captcha install

Status: Needs review » Needs work

The last submitted patch, 11: monitoringcaptchatest-2808087-11.patch, failed testing.

Ginovski’s picture

Status: Needs work » Needs review
FileSize
2.51 KB
3.59 KB

1. Added $form_ids initialization
2. Removed uuid's from default config forms.

Berdir’s picture

Title: MonitoringCaptchaTest fail » Improve captcha_install(), correctly create dynamic captcha points, move static captcha points to default config
Status: Needs review » Reviewed & tested by the community

Looks good to me.

wundo’s picture

  • wundo committed 13bd098 on 8.x-1.x authored by Ginovski
    Issue #2808087 by Ginovski, naveenvalecha, Berdir, ddrozdik: Improve...
wundo’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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