Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block grid areas validation for min and max validation error not updating until I reload the page #18639

Open
andr317c opened this issue Mar 11, 2025 · 2 comments

Comments

@andr317c
Copy link
Contributor

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

15.3.0-rc

Bug summary

Currently, I have content with a block Grid Editor that contains an area with a minimum or maximum amount of blocks required.
If I try to publish content with too few blocks in an area, I of course get a validation error. But if I add enough blocks to fit the minimum required amount of blocks, I still get an error when I try to publish the document. If I reload the page, I am allowed to publish, but this should not be necessary

Image

Specifics

No response

Steps to reproduce

  1. Create two element types 'Element One' and 'Element Two'
  2. Create a Block grid editor
  3. Add both block element types as blocks to the block grid
  4. Element One Block should be allowed at root and contain an area with min required blocks 2
  5. Element Two Block should be allowed in areas
  6. Create a document type with allow at root, with the Block Grid editor
  7. Create content with 1 Element One block.
  8. Add one Element Two block to the area
  9. Click Save and Publish
  10. See Validation error, which is correct.
  11. Add another Element Two block to the area which should fulfill the requirement.
  12. Click Save and Publish.
  13. Get error when trying to publish.
  14. Reload page.
  15. Click Save and Publish

Expected result / actual result

Actual: I have to reload or go out of the content node and back again for it to allow me to publish the node.

Expected: That I would be allowed to publish without reloading.

@AndyButland
Copy link
Contributor

Have reproduced this one. As far as I can tell it's an issue on the front-end as I've looked at the validation responses coming back from the server. In the first, invalid case, we get a response of:

    "errors": {
        "$.values[1].value": [
            "The content amount requirements are not met for one or more areas."
        ]
    }

Which is expected.

Having corrected by adding the required number of blocks, we get a 200 response from the server for validation.

But we still see this notification on the client side:

Image

@OskarKruger
Copy link
Contributor

After a look at how the validation takes place, it does seem to be a frontend validation error, where in the final call before going on to the Publish method, it complains about the following:
UmbValidationContext
UmbFormControlValidator
UmbServerModelValidatorContext

I'm thinking it must be in one of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants