-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Inconsistent cms block validation and save methods #4831
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
Comments
@vovayatsyuk, Thanks for the feedback. |
Thanks, I know why it shows an error and I wrote a proposed solution that will fix this behavior. If you'll dig into this a little more, you'll see that validation and save methods are inconsistent: Save method uses data from the request, while validation does not. Validation put a And that is a bug, I think. It's not a valid behavior when validation checks data that will not be saved actually. |
@vovayatsyuk thank you for your bug report. |
I am working on it at #mm17es |
this was fixed already #11805 |
Hi @vovayatsyuk |
I strongly disagree with this quote:
Let's work on it together to allow to do that and fix all possible issues (if any). Let me explain:
Additionally, when using a new approach, if I'll create a new store view I have to open cms block again and select newly created store view in store views combo box. Previously all work flawlessly because I always had a default block saved with "All store views" selected. p.s. The issue you are referring to (#8236) is about saving block with the same store_id while we are talking about different store_ids. |
Hello @vovayatsyuk Thank you for your feedback and collaboration! I am reopening this issue. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
✅ Confirmed by @engcom-Bravo Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hi @sergey-solo. Thank you for working on this issue.
|
@sdzhepa please revert and allow same identifier for specific store view. |
Hello @vovayatsyuk Thank you for contribution and collaboration! We are not able to reproduce this issue on the latest 2.4-develop branch by provided scenario.
Steps
AR: Block saved successfully Could You take a look? |
Looks like it was fixed in this commit: c8baed5 |
So we have to close it. |
Additional information
The issue was reopened on 16 July 2019.
The reopening reason is that current behavior(after fixes) brings new issues. See comment for details
Preconditions
Magento develop branch
Steps to reproduce
develop
branch.SingleStoreMode
option in disabledexample
forAll Store views
example
for first store view onlyExpected result
Actual result
An exception will be thrown:
Propose
Validator should validate actual block data, so we can remove the following check completely:
https://github.com/magento/magento2/blob/develop/app/code/Magento/Cms/Model/ResourceModel/Block.php#L186-L188
OR
this logic should be moved to
_beforeSave
and slightly modified, to checkSingleStoreMode
option:The text was updated successfully, but these errors were encountered: