You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PostViewLink Component breaks on undefined labels #62918
When editing some Template Files via the Website-Editor the Page died with a JS-Error Message in the console that the component could not access "view_item" on labels.
Happend when accessing a Template like the header. The Page is using a custom built theme/editor Plugin so the Error is probably caused by that (using the 2024-Theme it did not occur).
Even tho the Issue is caused by custom Coding, the Checks for undefined could/should be in Place.
Can be fixed by by changing the Line 16280 in editor.js from label: postType?.labels.view_item
to label: postType?.labels?.view_item
(added the ? to check if labels is defined).
Other occurence on Line 13819 in editor.js in the "PostURL" Component might be experiencing the same Issue - According to Info from Slack, this could be just removed.
Environment info
WP 6.5.5
Desktop with Windows 10
Chrome Version 126.0.6478.127
Custom built WP Theme (non-official)
Custom built WP Editor (non-official)
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Some further Digging revealed it appears that it is the "wp_template_part" PostType causing the Issues, this one is missing Labels, supports etc.
Found it later as it broke the PostTypeSupportCheck Component next
Further info on the PostTypeSupportCheck Component:
It broke due to the "wp_template_part" Posttype not having a supports Key. (editor.js:7248) -> Wrapped that in an if statement to circumvent the Issue for now
Activity
JNBG commentedon Jun 27, 2024
Some further Digging revealed it appears that it is the "wp_template_part" PostType causing the Issues, this one is missing Labels, supports etc.
Found it later as it broke the PostTypeSupportCheck Component next
JNBG commentedon Jun 27, 2024
Further info on the
PostTypeSupportCheckComponent:It broke due to the "wp_template_part" Posttype not having a
supportsKey. (editor.js:7248) -> Wrapped that in an if statement to circumvent the Issue for now