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 }}
This repository was archived by the owner on Aug 18, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 18, 2026. It is now read-only.
Media Partners term admin: media selection throws a JS error, fields lack accessible labels, and saved values cannot be cleared #4766
The built-in Media Partners optional module has three related issues on the Media Partner term administration screens:
Selecting a logo from the Media Library updates the hidden attachment ID and preview, but also throws an uncaught JavaScript exception.
The Partner URL and Attribution message controls do not have programmatically associated labels.
Once a Partner URL or custom Attribution message has been saved, clearing the field and updating the term does not remove or reset the old value.
All three issues reproduce in a fresh WordPress installation with no custom theme or other active plugins.
To Reproduce
Install a fresh WordPress site.
Activate Twenty Twenty-Five.
Install and activate only Newspack Plugin 6.42.3.
Enable the built-in Media Partners optional module.
Go to Posts → Media Partners.
Inspect the Partner URL and Attribution message controls:
On the add screen, the labels have for="partner_url" and for="attribution_message", but the corresponding controls have no id.
On the edit screen, the labels have empty for attributes and the controls also have no id.
Both controls consequently appear as unnamed textboxes in the browser accessibility tree.
Click Select/Upload Image, select an image from the Media Library and click Insert into post.
Observe that the logo ID and preview are updated, but the browser console reports:
TypeError: Cannot read properties of null (reading 'value')
at Object.insert (.../wp-includes/js/media-editor.min.js?ver=7.0.2:2:7974)
Create a Media Partner with:
Partner URL: https://example.com/original/
Attribution message: Original attribution
Edit the newly created Media Partner.
Delete the contents of both fields and click Update.
Observe that both original values return after the page reloads.
Actual behavior
Logo selection produces an uncaught exception in media-editor.min.js.
Partner URL and Attribution message have no accessible names derived from their visible labels.
Submitting either field empty leaves the previously stored term metadata unchanged.
After attempting to clear both fields, the persisted metadata remains:
partner_homepage_url https://example.com/original/
attribution_message Original attribution
Expected behavior
Selecting a logo should update the logo ID and preview without throwing a JavaScript exception.
Each visible label should be programmatically associated with its control through matching for and id attributes.
Clearing an existing value should not silently restore the previous value:
Partner URL should be removable.
Attribution message should either persist an intentional blank value or reset to the documented default, depending on the intended product behavior.
Environment
WordPress: 7.0.2
Newspack Plugin: 6.42.3
PHP: 8.2.30
Theme: Twenty Twenty-Five 1.5
Active plugins: Newspack Plugin only
Browser: Chromium 150
Site URL: local installation
Additional context
The affected implementation is in:
render_settings_field(): generated controls have no id; the edit-screen label also does not output its intended for value.
get_logo_upload_script(): the taxonomy screen uses the global wp.media.editor flow even though there is no post editor target.
save_partner_meta_fields(): URL and attribution metadata are updated only when the submitted values are truthy, with no handling for an intentionally submitted empty value.
The media-selection exception is non-fatal in this reproduction—the selected attachment is retained—but it is still an uncaught error and could interrupt other handlers.
Activity