Scott falconer 3558241 followup

I agree with the direction in MR !331 (remove the subrequest). I made small follow‑up adjustments to reduce review churn and improve correctness:

  • Cache hit accepts empty results: treat cached empty arrays as valid, so we don't recompute every request.
  • Consistent cache ID: use the base cache contexts for both cache get/set; response cacheability only affects tags + max‑age.
  • Functional test hardening: ensure block-derived Canvas components exist in the test by loading block plugin definitions; explicitly enable block in the test module list.

Testing performed

ddev phpcs modules/canvas_ai/src/CanvasAiPageBuilderHelper.php

ddev phpcs modules/canvas_ai/tests/src/Functional/CanvasAiFormRedirectTest.php

ddev phpunit modules/canvas_ai/tests/src/Functional/CanvasAiFormRedirectTest.php

Result: Pass (1 test, 12 assertions; PHPUnit deprecations reported by core).

AI disclosure: AI assistance used (https://github.com/scottfalconer/drupal-contribute-fix). Output reviewed and tests run manually.

Merge request reports

Loading