Problem/Motivation

When a paragraph is created using a format that another role does not have access to, an user with the role without the permission will only be able to save when the Paragraph is not collapsed. If collapsed the validation will fail and the user will get an error pointing to the weight of the paragraph.

Proposed resolution

Fix it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

yongt9412 created an issue. See original summary.

johnchque’s picture

Status: Active » Needs review
StatusFileSize
new2.62 KB

Failing test.

Status: Needs review » Needs work

The last submitted patch, 2: validation_error-3041808-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new8.9 KB

Thanks. As a quickfix, just filtering out validation errors on .format, as a bonus, I also improved the message we display, so it says a bit more, including the property path (which is very technical, but better than nothing).

berdir’s picture

StatusFileSize
new4.95 KB

Hm, PhpStorm did a bunch of unrelated cleanup there, removed again.

Status: Needs review » Needs work

The last submitted patch, 5: validation_error-3041808-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new4.93 KB
new661 bytes

Oops.

Status: Needs review » Needs work

The last submitted patch, 7: validation_error-3041808-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

berdir’s picture

Status: Needs work » Needs review
miro_dietiker’s picture

Yeah this looks cool.

However there are multiple (not yet covered) special cases related to this problem and we should cover them in follow-ups.

Reminder: We discussed that we should force-expand a Paragraph with validation error as the user needs to edit and fix the situation anyway to save. We need to be careful to check access for such an expansion and skip the validation for Paragraphs without access.

  • miro_dietiker committed 0fafd51 on 8.x-1.x authored by Berdir
    Issue #3041808 by Berdir, yongt9412: Validation error when user saves...

Status: Fixed » Closed (fixed)

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