Opened 5 weeks ago
Closed 11 days ago
#65073 closed defect (bug) (fixed)
Connectors: reference to AI plugin uses old `ai` slug instead of correct `ai-wp-admin` slug
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | AI | Keywords: | connectors |
| Focuses: | Cc: |
Description
As called out by @matt on Slack, it seems the Connectors page is linking to the old AI plugin settings page slug of ai instead of the new, updated ai-wp-admin. That new slug was required as part of the update of the settings page to use wp-build tooling in an effort to (1) help test and dogfood that package from the Gutenberg team and (2) ensure the page appeared in a more modern WordPress admin experience (versus a dated grey background / form fields everywhere sort of approach).
Attachments (3)
Change History (20)
#1
@
5 weeks ago
Looks like the source code for this is handled in the Gutenberg plugin. Opened a PR there to fix: https://github.com/WordPress/gutenberg/pull/77336
Not sure what else is needed here on Trac for that or if that will just auto-sync back to WordPress Core once merged.
#2
@
5 weeks ago
Moved upstream to https://github.com/WordPress/gutenberg/issues/77337
#4
@
5 weeks ago
Raised a PR for WordPress Core : https://github.com/WordPress/wordpress-develop/pull/11576
#5
@
5 weeks ago
A fix for this has now been backported for 7.0 and will make it to core in the next Gutenberg sync: https://github.com/WordPress/gutenberg/pull/77336#issuecomment-4245449831
This ticket was mentioned in PR #11614 on WordPress/wordpress-develop by @khokansardar.
4 weeks ago
#7
- Keywords has-patch added; needs-patch removed
## Summary
On Options → Connectors, after the AI plugin is installed and activated, the "Control features in the AI plugin" button links to options-general.php?page=ai. The AI plugin now registers its admin page under the slug ai-wp-admin, so the old URL produces a "you do not have sufficient permissions to access this page" error.
The AI_PLUGIN_SLUG = "ai" constant is used in two different contexts in routes/connectors-home/ai-plugin-callout.tsx:
- As the wp.org plugin directory slug in
saveEntityRecord( 'root', 'plugin', { slug: AI_PLUGIN_SLUG, status: 'active' } )to install the plugin — this must stay"ai". - As the admin settings page slug in
addQueryArgs( 'options-general.php', { page: AI_PLUGIN_SLUG } )— this is the broken one and must be"ai-wp-admin".
A single-value rename would break the install call, so this patch introduces a separate constant AI_PLUGIN_PAGE_SLUG = "ai-wp-admin" and uses it only at the settings-link use-site.
The variable name matches the upstream source-of-truth PR in Gutenberg (WordPress/gutenberg#77336), so these built-file changes line up with what core will receive via the next Gutenberg sync.
## Changes
src/wp-includes/build/routes/connectors-home/content.js— addAI_PLUGIN_PAGE_SLUG = "ai-wp-admin"and use it for thepage:query arg on the settings link.src/wp-includes/build/routes/connectors-home/content.min.js— same behavioral change (minified); the literal"ai-wp-admin"is inlined at the single use-site to avoid adding a new minified identifier, while the existingMt="ai"is preserved for the install call.
## Test plan
- [ ] Install and activate the AI plugin from the Connectors screen.
- [ ] Confirm the "Control features in the AI plugin" button now links to
wp-admin/options-general.php?page=ai-wp-adminand loads the plugin's settings page (no permissions error). - [ ] Confirm the install/activate flow still works (the wp.org slug
aiis unchanged for that path). - [ ] Visually verify the callout still renders correctly in the install, inactive, and active-no-provider states.
## Related
- Trac: #65073
- Upstream (Gutenberg): WordPress/gutenberg#77336
- Parallel core PR: #11576 (same fix, different variable name —
AI_PLUGIN_ADMIN_SLUG) - Duplicates on Trac: #65077, #65081
Props dkotter, JeffPaul, nimeshatxecurify, ocean90.
Made with Cursor
@khokansardar commented on PR #11614:
4 weeks ago
#8
Cross-reference: there is an earlier open PR for the same Trac ticket — #11576 — which introduces the constant as AI_PLUGIN_ADMIN_SLUG.
This PR uses the name AI_PLUGIN_PAGE_SLUG to match the upstream source-of-truth in Gutenberg (WordPress/gutenberg#77336), so the built files here line up with what core will receive at the next Gutenberg sync. Happy to defer to whichever approach a committer prefers; the behavioral change is identical.
This ticket was mentioned in Slack in #core-test by ozgur_sar. View the logs.
4 weeks ago
@JeffPaul commented on PR #11614:
4 weeks ago
#10
A fix for this was already backported and will make it into 7.0 with the next sync: https://github.com/WordPress/gutenberg/pull/77336#issuecomment-4245449831
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
4 weeks ago
#12
@
4 weeks ago
- Keywords close added
As per today's bug scrub: looks like this is going to be fixed on the next Gutenberg merge. Marking this ticket as candidate for closure when it is properly fixed.
@wildworks commented on PR #11614:
3 weeks ago
#14
The slug change was made in the Gutenberg repository: https://github.com/WordPress/gutenberg/pull/77336
That code will be built in the next sync and automatically applied to core. There is no need to make changes directly to core.
@
2 weeks ago
Update the AI plugin reference from the old ai slug to the correct ai-wp-admin slug in connectors home.
#15
@
2 weeks ago
Thank you for your work on this, @yusufmudagal. However, this code is auto-generated by the build process, so it cannot be directly edited.
This ticket does not require any action at this time. We will confirm the issue is resolved after the Gutenberg sync runs and then close it.
Connectors page where the AI plugin is referenced