Fixed logic for checking theme compatibility with @page properties (#17451)

no issue

- logic was incorrect in two places that meant we were showing the incompatibility warning for compatible themes
- `codedErrors` was looking at the Ember Data `errors` object instead of the renamed `gscanErrors` object
This commit is contained in:
Kevin Ansfield 2023-07-21 18:39:13 +02:00 committed by GitHub
parent 81e91e1c7a
commit 0b6c2e3421
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -165,7 +165,7 @@ export default class GhPostSettingsMenu extends Component {
}
get themeMissingShowTitleAndFeatureImage() {
return this.themeManagement.activeTheme.hasPageBuilderFeature('show_title_and_feature_image');
return !this.themeManagement.activeTheme.hasPageBuilderFeature('show_title_and_feature_image');
}
willDestroyElement() {

View File

@ -40,10 +40,10 @@ export default Model.extend({
return codedWarnings;
}),
codedErrors: computed('errors.[]', function () {
codedErrors: computed('gscanErrors.[]', function () {
const codedErrors = {};
this.errors.forEach((error) => {
this.gscanErrors.forEach((error) => {
if (!codedErrors[error.code]) {
codedErrors[error.code] = [];
}
@ -82,7 +82,7 @@ export default Model.extend({
}
return !failures['GS110-NO-MISSING-PAGE-BUILDER-USAGE'].some((failure) => {
return !failure.failures.some(({ref}) => ref === `@page.${feature}`);
return failure.failures.some(({ref}) => ref === `@page.${feature}`);
});
},