-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix broken widget placeholders after upgrading from 2.2 #19987
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
Fix broken widget placeholders after upgrading from 2.2 #19987
Conversation
This commit fixes widget previews for widgets inserted in Magento < 2.3, when 'type_name' property doesn't exist
This commit makes cleaner widget code. Widget name can be taken from plugin options by 'type' property
Hi @vovayatsyuk. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vovayatsyuk old widget declarations should be migrated automatically during upgrade, isn't it?
@orlangur oops, didn't test it, I just copy-paste a widget from third-party instructions :) However, I still think that the code introduced in 2.3 should be improved to be compatible with 2.2 when it's possible. Additionally, adding a new internal property ("type_name") is not a good solution because it doesn't work well for multiple backend users with different locales. p.s. We already have a "type" in widget declaration and it's enough to do the rest of work, why pollute widget declaration with new variables? |
Just checked updated store (2.2 to 2.3). Standard widget wasn't updated in store homepage:
|
Considering e4f6d5b#diff-7f5941d4c18c5f77dbccea6c32c5e6b5, @danmooney2 @irenelagno could you please evaluate this suggestion? |
Ping @danmooney2 @irenelagno. @melnikovi would appreciate your help as you seem to own |
This looks fine. Ideally type_name should be retained as a fallback for the sake of providing feedback when a type is uninstalled, skipped, etc. |
Hi @orlangur, thank you for the review. |
✔️ QA passed |
Hi @vovayatsyuk, thank you for your contribution! |
Affects backend editor when WYSIWYG is enabled and widget declarations are from Magento < 2.3.
Description (*)
This PR makes two things:
type_name
is not available in widget declarationtype_name
is not available in widget declarationManual testing scenarios (*)
Navigate to Content > Pages and create a new page
Disable WYSIWYG editor
Fill content field with following value (It's a widget code from Magento < 2.3):
Enable WYSIWYG editor
You will see an error icon instead of widget image
Contribution checklist (*)