diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index dd11be0405..b6c242b105 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -705,7 +705,11 @@ func CreateIssue(ctx *context.APIContext) { // Save custom field values if provided (resolve field names to IDs). if len(form.CustomFields) > 0 { defs, defErr := issues_model.GetCustomFieldsByOwner(ctx, ctx.Repo.Repository.OwnerID, issues_model.CustomFieldScopeIssue) - if defErr == nil && len(defs) > 0 { + if defErr != nil { + ctx.APIErrorInternal(defErr) + return + } + if len(defs) > 0 { vals := make(map[int64]string) for _, def := range defs { if v, ok := form.CustomFields[def.Name]; ok { diff --git a/routers/web/repo/issue_new.go b/routers/web/repo/issue_new.go index a3f359dfeb..d9993f8bf4 100644 --- a/routers/web/repo/issue_new.go +++ b/routers/web/repo/issue_new.go @@ -441,6 +441,7 @@ func saveCustomFieldsFromForm(ctx *context.Context, ownerID, issueID int64) { if len(vals) > 0 { if err := issues_model.SetCustomFieldValues(ctx, issueID, vals); err != nil { log.Error("saveCustomFieldsFromForm: %v", err) + ctx.Flash.Error("Failed to save custom field values") } } } diff --git a/services/updateserver/composer.go b/services/updateserver/composer.go index ad9326acfc..1833f2c4fc 100644 --- a/services/updateserver/composer.go +++ b/services/updateserver/composer.go @@ -87,8 +87,8 @@ func GenerateComposerJSON(ctx context.Context, repo *repo_model.Repository, lice } phpMin := "" - if cfg != nil && cfg.PHPMinimum != "" { - phpMin = ">=" + cfg.PHPMinimum + if meta.PHPMinimum != "" { + phpMin = ">=" + meta.PHPMinimum } streams := licenses.GetEffectiveStreams(ctx, repo.OwnerID, repo.ID) diff --git a/services/updateserver/joomla.go b/services/updateserver/joomla.go index 51319bc028..0b27508f98 100644 --- a/services/updateserver/joomla.go +++ b/services/updateserver/joomla.go @@ -164,13 +164,15 @@ func NormalizeChannel(ch string) string { // extensionMetadata holds resolved metadata for feed generation. // Fields are resolved with priority: custom field → config table → default. type extensionMetadata struct { - Element string - DisplayName string - ExtType string - TargetVersion string - PHPMinimum string - Description string - SupportURL string + Element string + DisplayName string + ExtType string + TargetVersion string + PHPMinimum string + Description string + SupportURL string + DownloadGating string + KeyPrefix string } // resolveExtensionMetadata loads extension metadata with cascading fallback: @@ -206,6 +208,12 @@ func resolveExtensionMetadata(ctx context.Context, repo *repo_model.Repository, if cfg.SupportURL != "" { m.SupportURL = cfg.SupportURL } + if cfg.DownloadGating != "" { + m.DownloadGating = cfg.DownloadGating + } + if cfg.KeyPrefix != "" { + m.KeyPrefix = cfg.KeyPrefix + } } // Override with custom field values (highest priority). @@ -244,11 +252,14 @@ func resolveExtensionMetadata(ctx context.Context, repo *repo_model.Repository, if v := named["Support URL"]; v != "" { m.SupportURL = v } - if v := named["Download Gating"]; v != "" && cfg != nil { - cfg.DownloadGating = v + if v := named["Description"]; v != "" { + m.Description = v } - if v := named["Key Prefix"]; v != "" && cfg != nil { - cfg.KeyPrefix = v + if v := named["Download Gating"]; v != "" { + m.DownloadGating = v + } + if v := named["Key Prefix"]; v != "" { + m.KeyPrefix = v } return m