- Issue created by @rkoller
- First commit to issue fork.
- π·π΄Romania amateescu
Looked into this today and it turns out that the language add/edit forms are using
#limit_validation_errors
and the workspace validation didn't account for that. - πΊπΈUnited States smustgrave
Thanks for always including test coverage from the jump!
1) Drupal\Tests\workspaces\Functional\WorkspaceFormValidationTest::testValidateLimitErrors Behat\Mink\Exception\ResponseTextException: The text "This form can only be submitted in the default workspace." was not found anywhere in the text of the current page. /builds/issue/drupal-3471675/vendor/behat/mink/src/WebAssert.php:907 /builds/issue/drupal-3471675/vendor/behat/mink/src/WebAssert.php:293 /builds/issue/drupal-3471675/core/tests/Drupal/Tests/WebAssert.php:979 /builds/issue/drupal-3471675/core/modules/workspaces/tests/src/Functional/WorkspaceFormValidationTest.php:56 FAILURES!
Test coverage appears to be there and following the test.
Following the steps provided I don't get an exception.
LGTM
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
There are merge conflicts on the phpstan baseline.
- π³πΏNew Zealand quietone
There are quite a few Functional test failures here in the Workspaces module.
- π·π΄Romania amateescu
amateescu β changed the visibility of the branch 3471675-improve-form-validation to hidden.
- π·π΄Romania amateescu
amateescu β changed the visibility of the branch 3471675-improve-form-validation to active.
- Status changed to Needs review
3 months ago 2:36pm 4 February 2025 - π·π΄Romania amateescu
Found the cause of those test failures, and implemented a quick workaround until π Hook ordering across OOP, procedural and with extra types Active is done.
- πΊπΈUnited States smustgrave
Won't this mean that entityFormAlter() won't be called?
- π·π΄Romania amateescu
Re #12: Nope, it's now called "manually" from
core/modules/workspaces/src/Hook/FormOperations::formAlter()
. It's easier to see if you look at the commit directly: https://git.drupalcode.org/project/drupal/-/merge_requests/10447/diffs?c... - Status changed to RTBC
30 days ago 3:23pm 9 April 2025 - πΊπΈUnited States smustgrave
Thanks, that was my only finding during the review.
- π¬π§United Kingdom catch
I don't think we should leave the hook method on the hooks class but without the attribute, it was confusing when reviewing, and could be confusing for anyone finding it later. Also hook ordering has landed, so we could probably use that directly in this issue now.
- π·π΄Romania amateescu
Yay, hook ordering actually works now :) Reverted that change and made
EntityOperations::entityFormAlter()
run first. Back to RTBC because there's no functional change to the MR and the current code has already been reviewed before. - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
The test failure was random. Workspaces isn't enabled by default in Drupal CMS, but there is work going on for the next months where this might be a blocker, so if we can fit it in 11.2.0 it would be great.