Commit b7623ff
Forms: Carry is_test via signed JWT source; a11y + unread-count polish
Follow-ups from review feedback on #48057:
- Replace the hidden-field + nonce injection in form preview rendering
with a flag baked into the signed JWT. Feedback_Source::get_current()
now reads Form_Preview::is_preview_mode() at render time and records
is_test=true on the source, which travels tamper-proof inside the
JWT to submission. JWTs issued before this change omit the flag and
continue to behave as regular submissions.
- Remove the now-unused inject_preview_submission_fields() helper,
verify_preview_submission() helper, and the three PREVIEW_SUBMIT_*
constants from Form_Preview.
- Drop the test-feedback special case in Feedback::save(); test
responses are now created as STATUS_UNREAD like any other response
so they contribute to the unread count.
- Add aria-label="Test response" to the inline Test badge in the
dashboard From column so screen readers get a complete label.
- Add two PHPUnit round-trip tests covering the JWT backward-compat
contract: a JWT issued in preview mode marks the decoded form as
a test submission; a JWT issued outside preview mode (or from a
cached HTML fragment predating this feature) decodes to a regular
submission.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 18f8a7d commit b7623ff
7 files changed
Lines changed: 123 additions & 238 deletions
File tree
- projects/packages/forms
- routes/responses
- src/contact-form
- tests/php/contact-form
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
470 | 475 | | |
471 | 476 | | |
472 | 477 | | |
| |||
Lines changed: 8 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
1623 | | - | |
1624 | | - | |
1625 | | - | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | 1623 | | |
1642 | 1624 | | |
1643 | 1625 | | |
| |||
1734 | 1716 | | |
1735 | 1717 | | |
1736 | 1718 | | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1740 | 1727 | | |
1741 | 1728 | | |
1742 | 1729 | | |
| |||
1925 | 1912 | | |
1926 | 1913 | | |
1927 | 1914 | | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | 1915 | | |
1933 | 1916 | | |
1934 | 1917 | | |
| |||
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | | - | |
| 188 | + | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
185 | 192 | | |
186 | | - | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
190 | | - | |
| 197 | + | |
191 | 198 | | |
192 | 199 | | |
193 | | - | |
| 200 | + | |
194 | 201 | | |
195 | 202 | | |
196 | 203 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | 1485 | | |
1491 | 1486 | | |
1492 | 1487 | | |
| |||
1497 | 1492 | | |
1498 | 1493 | | |
1499 | 1494 | | |
1500 | | - | |
| 1495 | + | |
1501 | 1496 | | |
1502 | 1497 | | |
1503 | 1498 | | |
| |||
Lines changed: 9 additions & 100 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 26 | | |
49 | 27 | | |
50 | 28 | | |
| |||
317 | 295 | | |
318 | 296 | | |
319 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
320 | 304 | | |
321 | 305 | | |
322 | 306 | | |
| |||
333 | 317 | | |
334 | 318 | | |
335 | 319 | | |
336 | | - | |
337 | | - | |
| 320 | + | |
338 | 321 | | |
339 | | - | |
| 322 | + | |
340 | 323 | | |
341 | 324 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | 325 | | |
346 | 326 | | |
347 | 327 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | 328 | | |
418 | 329 | | |
419 | 330 | | |
| |||
433 | 344 | | |
434 | 345 | | |
435 | 346 | | |
436 | | - | |
437 | | - | |
438 | | - | |
| 347 | + | |
439 | 348 | | |
440 | 349 | | |
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2700 | 2700 | | |
2701 | 2701 | | |
2702 | 2702 | | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
2703 | 2791 | | |
2704 | 2792 | | |
2705 | 2793 | | |
| |||
0 commit comments