Compare commits

...

2 Commits

Author SHA1 Message Date
gitea-actions[bot] 7eea1db394 chore(release): build 06.16.00-rc [skip ci] 2026-06-18 19:55:38 +00:00
Jonathan Miller dbd6103acb fix: lowercase and clean Joomla element names in AutoElementName (#635)
Generic: Project CI / Tests (pull_request) Blocked by required conditions
Generic: Repo Health / Scripts governance (pull_request) Blocked by required conditions
Generic: Repo Health / Repository health (pull_request) Blocked by required conditions
Generic: Repo Health / Report Issues (pull_request) Blocked by required conditions
Branch Policy Check / Verify merge target (pull_request) Failing after 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 2s
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Access control (push) Successful in 2s
Generic: Repo Health / Site Health (push) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Universal: Auto Version Bump / Version Bump (push) Successful in 8s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
Generic: Project CI / Lint & Validate (pull_request) Successful in 41s
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been skipped
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Successful in 46s
PR RC Release / Build RC Release (pull_request) Failing after 46s
AutoElementName() was using m.Name directly without lowercasing or
cleaning, producing elements like pkg_MokoSuiteBackup instead of
pkg_mokosuitebackup. Joomla's InstallerAdapter always lowercases
and runs InputFilter::clean('cmd') which strips non-alphanumeric
chars (except . _ -).

Added cleanJoomlaElement() to replicate Joomla's cmd filter.
Removed incorrect "plugin": "plg_" prefix — Joomla plugins use
bare element names without a prefix.

Fixes #635
2026-06-18 14:02:37 -05:00
4 changed files with 27 additions and 22 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<name>MokoGitea</name>
<org>MokoConsulting</org>
<description>Moko fork of Gitea - adding project board REST API endpoints and custom enhancements</description>
<version>06.15.00</version>
<version>06.16.00</version>
<version-prefix>v1.26.1+MOKO</version-prefix>
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
</identity>
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION
# DEFGROUP: Gitea.Workflow
# INGROUP: mokoplatform.Automation
# VERSION: 06.15.00
# VERSION: 06.16.00
# BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch"
+3 -16
View File
@@ -1,7 +1,9 @@
# Changelog
## [Unreleased]
## [06.16.00] --- 2026-06-18
## [06.15.00] --- 2026-06-12
## [06.15.00] --- 2026-06-12
@@ -44,18 +46,3 @@
All notable changes to MokoGitea are documented here. Versions follow the format
`v{upstream}-moko.{major}.{minor}` (e.g. `v1.26.1-moko.06.03`).
## [06.14.00] --- 2026-06-09
* FEATURES
* feat(api): issue status/priority/type exposed in REST API - GET/PATCH on issues now includes status_id, priority_id, type_id with resolved names
* feat(api): org-level issue metadata endpoints - GET /orgs/{org}/issue-statuses, /issue-priorities, /issue-types
* feat(wiki): org wiki tab - inline wiki rendering from convention repos (wiki / wiki-private)
* feat(wiki): public/private wiki toggle dropdown (same UX as org profile README selector)
* feat(wiki): external wiki support - link to an outside URL from the org wiki tab
* feat(settings): wiki mode setting in org settings (internal repos vs external URL)
* feat(mcp): 5 new MCP tools - gitea_org_issue_statuses_list, gitea_org_issue_priorities_list, gitea_org_issue_types_list, gitea_issue_set_status, gitea_issue_set_priority
* feat(mcp): gitea_issue_create and gitea_issue_update now accept status_id, priority_id, type_id
* MIGRATIONS
* migration 354: add wiki_mode and wiki_url columns to user table for org wiki settings
+22 -4
View File
@@ -5,6 +5,7 @@ package repo
import (
"context"
"strings"
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/db"
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/timeutil"
@@ -60,25 +61,42 @@ func (RepoManifest) TableName() string {
}
// joomlaTypePrefix maps Joomla extension types to their element name prefixes.
// Derived from Joomla 6 source: libraries/src/Installer/Adapter/*Adapter.php
// Plugins use bare names (no prefix) — Joomla stores them as just the element name.
var joomlaTypePrefix = map[string]string{
"component": "com_",
"module": "mod_",
"plugin": "plg_",
"package": "pkg_",
"template": "tpl_",
"library": "lib_",
"file": "file_",
}
// AutoElementName returns the auto-constructed Joomla element name (e.g. pkg_mokowaas).
// cleanJoomlaElement replicates Joomla's InputFilter::clean($value, 'cmd')
// which lowercases and strips all characters except [a-z0-9._-].
func cleanJoomlaElement(name string) string {
lower := strings.ToLower(name)
var b strings.Builder
b.Grow(len(lower))
for _, r := range lower {
if (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '.' || r == '_' || r == '-' {
b.WriteRune(r)
}
}
return b.String()
}
// AutoElementName returns the auto-constructed Joomla element name (e.g. pkg_mokosuitebackup).
// The name is lowercased and cleaned to match Joomla's InputFilter::clean('cmd') behavior.
func (m *RepoManifest) AutoElementName() string {
if m.Name == "" || m.PackageType == "" {
return ""
}
cleaned := cleanJoomlaElement(m.Name)
if prefix, ok := joomlaTypePrefix[m.PackageType]; ok {
return prefix + m.Name
return prefix + cleaned
}
return m.Name
return cleaned
}
// FullElementName returns the effective element name: override if set, otherwise auto-constructed.