fix(products): plan editor pins Customer Role to resolved default, overriding global Default Role
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #2082 来自 @superdav42 —— 已合并
评估
调研方向
Read inc/admin-pages/class-product-edit-admin-page.php around line 757 and inc/limitations/class-limit-customer-user-role.php around line 74 to understand how the plan editor gets the customer role. The issue describes the fix: show the stored value, falling back to default; check that saving an untouched plan preserves default and that existing explicit roles remain visible. Pull request #2082 is already open against this issue.
由索引模型根据 Issue 内容生成。
描述
Problem
Customer reports that with Settings → Login & Registration → Default Role set to a custom role ("CRM Admin"), new customers are still added to their site as Administrator.
Root cause
The plan editor's Customer Role select (inc/admin-pages/class-product-edit-admin-page.php:757) uses Product::get_customer_role(), which resolves an unset/default limit to the current global default_role (inc/limitations/class-limit-customer-user-role.php:74). So "Use Ultimate Multisite default" is never shown as selected; the select shows the resolved role (administrator out of the box). Saving the plan then stores that role explicitly, and Site::save() (inc/models/class-site.php:2238-2241) prefers the plan's role over the global setting from then on. Changing Default Role later has no effect on that plan.
Fix
Show the stored value in the editor, falling back to default, so saving a plan without touching the field keeps following the global setting.
Verification
Dev network, global Default Role later switched to WooCommerce shop_manager, site cloned from template via pending-site publish:
- Plan saved with the old editor value → stored
administrator→ customer getsadministrator. - Plan saved with the patched editor value → stored
default→ customer getsshop_manager.
Existing plans that already have an explicit role keep it; the editor now displays it so admins can switch to "Use Ultimate Multisite default".
- 主要语言
- PHP
- 星标
- 218
- 派生
- 88
- 平均合并
- 1 天 5 小时
- 30 天内合并 PR
- 94
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Ultimate-Multisite/ultimate-multisite 的其他 Issue
-
Track interactive PR #2086可能重新可做 关联的 PR 已关闭且未合并。 未关闭origin:worker source:conflict-feedback status:available
难度 4/5 3-5 天 新手友好度 1/100
Ultimate-Multisite/ultimate-multisite#2090 · 1 条评论 ·
维护者通常 1 天内回复
-
Track interactive PR #2087可能重新可做 关联的 PR 已关闭且未合并。 未关闭origin:worker source:conflict-feedback status:available
难度 4/5 3-5 天 新手友好度 1/100
Ultimate-Multisite/ultimate-multisite#2089 · 1 条评论 ·
维护者通常 1 天内回复
-
no-auto-dispatch operator:superdav42 origin:worker priority:high status:available
难度 4/5 3-5 天 新手友好度 35/100
Ultimate-Multisite/ultimate-multisite#2083 ·
维护者通常 1 天内回复
-
Domain mapping: apply primary mapped domain to home_url/site_url for other sites, not only the current request host可能已有人在做 @superdav42 于 3 天前认领。 未关闭bug origin:interactive status:in-review
难度 4/5 3-5 天 新手友好度 55/100
Ultimate-Multisite/ultimate-multisite#2080 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Clearer default custom-domain DNS instructions and configurable DNS target可能已有人在做 @superdav42 于 6 天前认领。 未关闭enhancement origin:worker source:ci-feedback status:in-review
难度 3/5 1-2 天 新手友好度 35/100
Ultimate-Multisite/ultimate-multisite#2067 · 14 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 Ultimate-Multisite/ultimate-multisite 的全部 Issue
相似的 Issue
-
enhancement priority Sales
难度 2/5 1-3 小时 新手友好度 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 74/100
web-token/jwt-framework#757 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Include flows spanning the full report time window可能已有人在做 @somethingwithproof 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
Cacti/plugin_flowview#306 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
wintercms/wn-sitemap-plugin#31 · 2 条评论 ·