-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Modifying a block's HTML can cause an unexpected "This block appears to have been modified externally." error #6826
Comments
Hi @sandeshjangam, Thanks for the report. This behavior is by design, so I think it's unlikely to change. @mtias @youknowriad Is there some existing documentation for the rationale behind this design decision? |
@danielbachhuber Thanks for considering this. We need to find something for this as it will create trouble while fixing bugs of the block. Possible Solution => In editor mode, we will render HTML from block code instead of the saved block HTML. |
@sandeshjangam @danielbachhuber changes to a block markup (it includes class names and attributes) are meant to be handled through the native That said, when looking specifically at classes there is room for the thought they should not be considered as relevant changes when comparing source and output. This is debatable, though, and could introduce a level of fragility that is hard to account for. The fact your block is being recognized as having an issue is actually telling you that a portion of your users would be in the previous version of the markup, and that your knew shape doesn't account for them. Going to close the issue, but feel free to continue the conversation. |
@mtias Can you explain the rationale behind "Edit as HTML" if you can't edit the HTML? |
Related #4522 (comment) |
You can edit in HTML. If you break the validation with your changes you are offered the option of keeping it as an HTML block. |
Yes, should probably rename to "Keep as HTML" or similar. And the overall writing of the message should be tweaked as well to be less presumptuous in having edited it externally when you haven't :) |
More conversation in https://wordpress.slack.com/archives/C02QB2JS7/p1527696785000069 Some key bits:
|
Flagging as |
Consolidating planned improvements on #7604. |
Describe the bug
If I modify custom block's class name or attribute then "This block appears to have been modified externally." this error is appearing.
To Reproduce
Expected behavior
If HTML or attribute changing from code then it should not show this error. Because users value will be same we are just changing the HTML and its class to fix the bugs or change the way of showing.
If this is the natural behavior then it will be very hard to fix block bugs or add a feature in the block because if you touch any part in the code it will throw this error.
Screenshots
https://imgur.com/a/fAPeQ0O
The text was updated successfully, but these errors were encountered: