Compare commits

..

5 Commits

Author SHA1 Message Date
gitea-actions[bot] 8858c81f87 chore(version): pre-release bump to 01.06.03-dev [skip ci] 2026-06-29 14:41:27 +00:00
jmiller 5b1fb1584e Merge pull request 'fix: resolve release blockers #97 (scalar JSON-LD 500) and #98 (no single-tag edit UI)' (#108) from fix/release-blockers-97-98 into dev
Universal: Auto Version Bump / Version Bump (push) Has been skipped
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 18s
2026-06-29 14:41:12 +00:00
gitea-actions[bot] e6328a1e8d chore(version): pre-release bump to 01.06.02-dev [skip ci]
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 1s
2026-06-29 14:36:11 +00:00
jmiller 8582a3eac5 fix: resolve release blockers #97 (scalar JSON-LD 500) and #98 (no edit UI)
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 20s
#97 — Fatal frontend 500 from scalar custom_schema:
- MokoOGContent::validateJson() now requires a JSON object/array (rejects
  scalars like 42/"x"/true that previously passed and were stored)
- MokoOG render path guards with is_array($decoded) so already-stored
  scalar payloads can no longer crash the public page

#98 — Missing single-tag create/edit admin UI:
- Add Controller/TagController (FormController), View/Tag/HtmlView, tmpl/tag/edit.php
- Link OG title in the list to the editor; add New/Edit toolbar buttons
- Declare tmpl/tag folder in the component manifest
- tag.xml: switch cross-package PLG_CONTENT_* labels to COM_MOKOOG_* keys,
  make content_type/content_id editable+required (enables New), add language field
- Add the new COM_MOKOOG_* strings to en-GB and en-US

Also fixes #77 while here: seo_title/meta_description form maxlength now
match the DB columns (70/200) instead of 255.
2026-06-29 09:35:36 -05:00
gitea-actions[bot] 6d4284c6c9 chore(version): pre-release bump to 01.05.02-dev [skip ci] 2026-06-28 19:51:06 +00:00
25 changed files with 234 additions and 33 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION # FILE INFORMATION
# DEFGROUP: Gitea.Workflow # DEFGROUP: Gitea.Workflow
# INGROUP: mokocli.Automation # INGROUP: mokocli.Automation
# VERSION: 01.06.00 # VERSION: 01.06.03
# BRIEF: Auto-create feature branch when an issue is opened # BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch" name: "Universal: Issue Branch"
+1 -6
View File
@@ -2,15 +2,10 @@
## [Unreleased] ## [Unreleased]
## [01.06.00] --- 2026-06-28
## [01.06.00] --- 2026-06-28
## [01.05.00] --- 2026-06-28 ## [01.05.00] --- 2026-06-28
<!-- VERSION: 01.06.00 --> <!-- VERSION: 01.06.03 -->
All notable changes to MokoSuiteOpenGraph will be documented in this file. All notable changes to MokoSuiteOpenGraph will be documented in this file.
+1 -1
View File
@@ -14,7 +14,7 @@
DEFGROUP: Template-Joomla DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation INGROUP: Template-Joomla.Documentation
REPO: https://github.com/mokoconsulting-tech/Template-Joomla/ REPO: https://github.com/mokoconsulting-tech/Template-Joomla/
VERSION: 01.06.00 VERSION: 01.06.03
PATH: ./CODE_OF_CONDUCT.md PATH: ./CODE_OF_CONDUCT.md
BRIEF: Community expectations and enforcement guidelines BRIEF: Community expectations and enforcement guidelines
NOTE: Adapted with attribution from the Contributor Covenant v2.1 NOTE: Adapted with attribution from the Contributor Covenant v2.1
+1 -1
View File
@@ -19,7 +19,7 @@
DEFGROUP: mokoconsulting-tech.Template-Joomla DEFGROUP: mokoconsulting-tech.Template-Joomla
INGROUP: MokoStandards.Governance INGROUP: MokoStandards.Governance
REPO: https://github.com/mokoconsulting-tech/Template-Joomla REPO: https://github.com/mokoconsulting-tech/Template-Joomla
VERSION: 01.06.00 VERSION: 01.06.03
PATH: /GOVERNANCE.md PATH: /GOVERNANCE.md
BRIEF: Project governance rules, roles, and decision process for Template-Joomla BRIEF: Project governance rules, roles, and decision process for Template-Joomla
--> -->
+1 -1
View File
@@ -1,6 +1,6 @@
# MokoSuiteOpenGraph # MokoSuiteOpenGraph
<!-- VERSION: 01.06.00 --> <!-- VERSION: 01.06.03 -->
Open Graph, Twitter Card, and social sharing meta tag management for Joomla 6 and higher. Open Graph, Twitter Card, and social sharing meta tag management for Joomla 6 and higher.
+1 -1
View File
@@ -23,7 +23,7 @@ DEFGROUP: Template-Joomla
INGROUP: Template-Joomla.Documentation INGROUP: Template-Joomla.Documentation
REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Joomla
PATH: /SECURITY.md PATH: /SECURITY.md
VERSION: 01.06.00 VERSION: 01.06.03
BRIEF: Security vulnerability reporting and handling policy BRIEF: Security vulnerability reporting and handling policy
--> -->
+23 -13
View File
@@ -16,13 +16,15 @@
name="content_type" name="content_type"
type="text" type="text"
label="COM_MOKOOG_FIELD_CONTENT_TYPE" label="COM_MOKOOG_FIELD_CONTENT_TYPE"
readonly="true" description="COM_MOKOOG_FIELD_CONTENT_TYPE_DESC"
required="true"
/> />
<field <field
name="content_id" name="content_id"
type="number" type="number"
label="COM_MOKOOG_FIELD_CONTENT_ID" label="COM_MOKOOG_FIELD_CONTENT_ID"
readonly="true" description="COM_MOKOOG_FIELD_CONTENT_ID_DESC"
required="true"
/> />
<field <field
name="og_title" name="og_title"
@@ -77,37 +79,45 @@
<option value="1">JPUBLISHED</option> <option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option> <option value="0">JUNPUBLISHED</option>
</field> </field>
<field
name="language"
type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
default="*"
>
<option value="*">JALL</option>
</field>
</fieldset> </fieldset>
<fieldset name="seo" label="SEO Meta Tags"> <fieldset name="seo" label="COM_MOKOOG_FIELDSET_SEO">
<field <field
name="seo_title" name="seo_title"
type="text" type="text"
label="PLG_CONTENT_MOKOOG_FIELD_SEO_TITLE" label="COM_MOKOOG_FIELD_SEO_TITLE"
description="PLG_CONTENT_MOKOOG_FIELD_SEO_TITLE_DESC" description="COM_MOKOOG_FIELD_SEO_TITLE_DESC"
filter="string" filter="string"
maxlength="255" maxlength="70"
/> />
<field <field
name="meta_description" name="meta_description"
type="textarea" type="textarea"
label="PLG_CONTENT_MOKOOG_FIELD_META_DESCRIPTION" label="COM_MOKOOG_FIELD_META_DESCRIPTION"
description="PLG_CONTENT_MOKOOG_FIELD_META_DESCRIPTION_DESC" description="COM_MOKOOG_FIELD_META_DESCRIPTION_DESC"
filter="string" filter="string"
rows="3" rows="3"
maxlength="255" maxlength="200"
/> />
<field <field
name="robots" name="robots"
type="text" type="text"
label="PLG_CONTENT_MOKOOG_FIELD_ROBOTS" label="COM_MOKOOG_FIELD_ROBOTS"
description="PLG_CONTENT_MOKOOG_FIELD_ROBOTS_DESC" description="COM_MOKOOG_FIELD_ROBOTS_DESC"
filter="string" filter="string"
/> />
<field <field
name="canonical_url" name="canonical_url"
type="url" type="url"
label="PLG_CONTENT_MOKOOG_FIELD_CANONICAL_URL" label="COM_MOKOOG_FIELD_CANONICAL_URL"
description="PLG_CONTENT_MOKOOG_FIELD_CANONICAL_URL_DESC" description="COM_MOKOOG_FIELD_CANONICAL_URL_DESC"
filter="url" filter="url"
/> />
</fieldset> </fieldset>
@@ -66,3 +66,19 @@ COM_MOKOOG_COVERAGE_ARTICLES="%d of %d articles have OG tags"
COM_MOKOOG_COVERAGE_MISSING_TITLE="%d tags missing custom title" COM_MOKOOG_COVERAGE_MISSING_TITLE="%d tags missing custom title"
COM_MOKOOG_COVERAGE_MISSING_DESC="%d tags missing custom description" COM_MOKOOG_COVERAGE_MISSING_DESC="%d tags missing custom description"
COM_MOKOOG_COVERAGE_MISSING_IMAGE="%d tags missing custom image" COM_MOKOOG_COVERAGE_MISSING_IMAGE="%d tags missing custom image"
; Single-tag edit form
COM_MOKOOG_TAG_NEW="MokoSuiteOpenGraph - New OG Tag"
COM_MOKOOG_TAG_EDIT="MokoSuiteOpenGraph - Edit OG Tag"
COM_MOKOOG_TAB_DETAILS="Details"
COM_MOKOOG_FIELDSET_SEO="SEO Meta Tags"
COM_MOKOOG_FIELD_CONTENT_TYPE_DESC="The content type this OG tag applies to (e.g. com_content, menu, com_content.category)."
COM_MOKOOG_FIELD_CONTENT_ID_DESC="The ID of the content item this OG tag applies to."
COM_MOKOOG_FIELD_SEO_TITLE="SEO Title"
COM_MOKOOG_FIELD_SEO_TITLE_DESC="Overrides the page &lt;title&gt; tag (max 70 characters)."
COM_MOKOOG_FIELD_META_DESCRIPTION="Meta Description"
COM_MOKOOG_FIELD_META_DESCRIPTION_DESC="Overrides the page meta description (max 200 characters)."
COM_MOKOOG_FIELD_ROBOTS="Robots"
COM_MOKOOG_FIELD_ROBOTS_DESC="Per-page robots directive, e.g. noindex, nofollow."
COM_MOKOOG_FIELD_CANONICAL_URL="Canonical URL"
COM_MOKOOG_FIELD_CANONICAL_URL_DESC="Overrides the canonical URL for this content item (http/https only)."
@@ -66,3 +66,19 @@ COM_MOKOOG_COVERAGE_ARTICLES="%d of %d articles have OG tags"
COM_MOKOOG_COVERAGE_MISSING_TITLE="%d tags missing custom title" COM_MOKOOG_COVERAGE_MISSING_TITLE="%d tags missing custom title"
COM_MOKOOG_COVERAGE_MISSING_DESC="%d tags missing custom description" COM_MOKOOG_COVERAGE_MISSING_DESC="%d tags missing custom description"
COM_MOKOOG_COVERAGE_MISSING_IMAGE="%d tags missing custom image" COM_MOKOOG_COVERAGE_MISSING_IMAGE="%d tags missing custom image"
; Single-tag edit form
COM_MOKOOG_TAG_NEW="MokoSuiteOpenGraph - New OG Tag"
COM_MOKOOG_TAG_EDIT="MokoSuiteOpenGraph - Edit OG Tag"
COM_MOKOOG_TAB_DETAILS="Details"
COM_MOKOOG_FIELDSET_SEO="SEO Meta Tags"
COM_MOKOOG_FIELD_CONTENT_TYPE_DESC="The content type this OG tag applies to (e.g. com_content, menu, com_content.category)."
COM_MOKOOG_FIELD_CONTENT_ID_DESC="The ID of the content item this OG tag applies to."
COM_MOKOOG_FIELD_SEO_TITLE="SEO Title"
COM_MOKOOG_FIELD_SEO_TITLE_DESC="Overrides the page &lt;title&gt; tag (max 70 characters)."
COM_MOKOOG_FIELD_META_DESCRIPTION="Meta Description"
COM_MOKOOG_FIELD_META_DESCRIPTION_DESC="Overrides the page meta description (max 200 characters)."
COM_MOKOOG_FIELD_ROBOTS="Robots"
COM_MOKOOG_FIELD_ROBOTS_DESC="Per-page robots directive, e.g. noindex, nofollow."
COM_MOKOOG_FIELD_CANONICAL_URL="Canonical URL"
COM_MOKOOG_FIELD_CANONICAL_URL_DESC="Overrides the canonical URL for this content item (http/https only)."
+2 -1
View File
@@ -8,7 +8,7 @@
--> -->
<extension type="component" method="upgrade"> <extension type="component" method="upgrade">
<name>com_mokoog</name> <name>com_mokoog</name>
<version>01.06.00</version> <version>01.06.03</version>
<creationDate>2026-05-23</creationDate> <creationDate>2026-05-23</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
@@ -50,6 +50,7 @@
<folder>View</folder> <folder>View</folder>
</files> </files>
<files folder="tmpl"> <files folder="tmpl">
<folder>tag</folder>
<folder>tags</folder> <folder>tags</folder>
</files> </files>
<files folder="sql"> <files folder="sql">
@@ -0,0 +1 @@
/* 01.05.02 — no schema changes */
@@ -1 +0,0 @@
/* 01.06.00 — no schema changes */
@@ -0,0 +1 @@
/* 01.06.02 — no schema changes */
@@ -0,0 +1 @@
/* 01.06.03 — no schema changes */
@@ -0,0 +1,31 @@
<?php
/**
* @package MokoSuiteOpenGraph
* @subpackage com_mokoog
* @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
*/
namespace Joomla\Component\MokoOG\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\FormController;
/**
* Controller for a single OG tag record.
*
* Provides the standard add/edit/save/apply/cancel tasks via FormController,
* backed by the existing TagModel (AdminModel) and TagTable.
*/
class TagController extends FormController
{
/**
* The list view to redirect to after save/cancel.
*
* @var string
*/
protected $view_list = 'tags';
}
@@ -0,0 +1,76 @@
<?php
/**
* @package MokoSuiteOpenGraph
* @subpackage com_mokoog
* @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
*/
namespace Joomla\Component\MokoOG\Administrator\View\Tag;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
/**
* Edit view for a single OG tag record.
*/
class HtmlView extends BaseHtmlView
{
/**
* The edit form.
*
* @var \Joomla\CMS\Form\Form
*/
protected $form;
/**
* The item being edited.
*
* @var object
*/
protected $item;
/**
* Display the view.
*
* @param string $tpl Template name
*
* @return void
*/
public function display($tpl = null): void
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the edit toolbar.
*
* @return void
*/
protected function addToolbar(): void
{
Factory::getApplication()->getInput()->set('hidemainmenu', true);
$isNew = empty($this->item->id);
ToolbarHelper::title(
Text::_($isNew ? 'COM_MOKOOG_TAG_NEW' : 'COM_MOKOOG_TAG_EDIT'),
'bookmark'
);
ToolbarHelper::apply('tag.apply');
ToolbarHelper::save('tag.save');
ToolbarHelper::cancel('tag.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
}
}
@@ -81,6 +81,8 @@ class HtmlView extends BaseHtmlView
protected function addToolbar(): void protected function addToolbar(): void
{ {
ToolbarHelper::title(Text::_('COM_MOKOOG_TAGS_TITLE'), 'bookmark'); ToolbarHelper::title(Text::_('COM_MOKOOG_TAGS_TITLE'), 'bookmark');
ToolbarHelper::addNew('tag.add');
ToolbarHelper::editList('tag.edit');
ToolbarHelper::custom('batch.generate', 'refresh', '', 'COM_MOKOOG_TOOLBAR_BATCH_GENERATE', false); ToolbarHelper::custom('batch.generate', 'refresh', '', 'COM_MOKOOG_TOOLBAR_BATCH_GENERATE', false);
ToolbarHelper::custom('importexport.export', 'download', '', 'COM_MOKOOG_TOOLBAR_EXPORT', false); ToolbarHelper::custom('importexport.export', 'download', '', 'COM_MOKOOG_TOOLBAR_EXPORT', false);
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'tags.delete'); ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'tags.delete');
@@ -0,0 +1,41 @@
<?php
/**
* @package MokoSuiteOpenGraph
* @subpackage com_mokoog
* @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\MokoOG\Administrator\View\Tag\HtmlView $this */
HTMLHelper::_('behavior.formvalidator');
?>
<form action="<?php echo Route::_('index.php?option=com_mokoog&view=tag&layout=edit&id=' . (int) ($this->item->id ?? 0)); ?>"
method="post" name="adminForm" id="adminForm" class="form-validate" aria-label="<?php echo $this->escape(Text::_('COM_MOKOOG_TAG_EDIT')); ?>">
<div class="row">
<div class="col-lg-9">
<?php echo HTMLHelper::_('uitab.startTabSet', 'mokoogTab', ['active' => 'details']); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'mokoogTab', 'details', Text::_('COM_MOKOOG_TAB_DETAILS')); ?>
<?php echo $this->form->renderFieldset('details'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'mokoogTab', 'seo', Text::_('COM_MOKOOG_FIELDSET_SEO')); ?>
<?php echo $this->form->renderFieldset('seo'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
</div>
</div>
<input type="hidden" name="task" value="">
<?php echo HTMLHelper::_('form.token'); ?>
</form>
@@ -85,7 +85,9 @@ $token = Session::getFormToken();
<?php echo (int) $item->content_id; ?> <?php echo (int) $item->content_id; ?>
</td> </td>
<td> <td>
<a href="<?php echo Route::_('index.php?option=com_mokoog&task=tag.edit&id=' . (int) $item->id); ?>" title="<?php echo Text::_('JACTION_EDIT'); ?>">
<?php echo $this->escape($item->og_title ?: '(' . Text::_('COM_MOKOOG_AUTO_GENERATED') . ')'); ?> <?php echo $this->escape($item->og_title ?: '(' . Text::_('COM_MOKOOG_AUTO_GENERATED') . ')'); ?>
</a>
</td> </td>
<td> <td>
<?php if ($item->og_image) : ?> <?php if ($item->og_image) : ?>
@@ -8,7 +8,7 @@
--> -->
<extension type="plugin" group="content" method="upgrade"> <extension type="plugin" group="content" method="upgrade">
<name>Content - MokoSuiteOpenGraph</name> <name>Content - MokoSuiteOpenGraph</name>
<version>01.06.00</version> <version>01.06.03</version>
<creationDate>2026-05-23</creationDate> <creationDate>2026-05-23</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
@@ -322,7 +322,14 @@ final class MokoOGContent extends CMSPlugin implements SubscriberInterface
{ {
$json = trim($json); $json = trim($json);
if ($json === '' || json_decode($json) === null) { if ($json === '') {
return '';
}
// Only accept JSON objects/arrays. Scalars (42, "x", true) decode to a
// non-null value but would crash the frontend renderer when treated as
// an array (writing $decoded['@context'] onto a scalar is a fatal error).
if (!\is_array(json_decode($json, true))) {
return ''; return '';
} }
+1 -1
View File
@@ -8,7 +8,7 @@
--> -->
<extension type="plugin" group="system" method="upgrade"> <extension type="plugin" group="system" method="upgrade">
<name>System - MokoSuiteOpenGraph</name> <name>System - MokoSuiteOpenGraph</name>
<version>01.06.00</version> <version>01.06.03</version>
<creationDate>2026-05-23</creationDate> <creationDate>2026-05-23</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
@@ -358,7 +358,9 @@ final class MokoOG extends CMSPlugin implements SubscriberInterface
if (!empty($customSchema)) { if (!empty($customSchema)) {
$decoded = json_decode($customSchema, true); $decoded = json_decode($customSchema, true);
if ($decoded) { // Guard against scalar/invalid payloads — only arrays/objects are
// valid JSON-LD. Writing an array offset onto a scalar is fatal.
if (\is_array($decoded) && $decoded !== []) {
if (empty($decoded['@context'])) { if (empty($decoded['@context'])) {
$decoded['@context'] = 'https://schema.org'; $decoded['@context'] = 'https://schema.org';
} }
@@ -8,7 +8,7 @@
--> -->
<extension type="plugin" group="webservices" method="upgrade"> <extension type="plugin" group="webservices" method="upgrade">
<name>Web Services - MokoSuiteOpenGraph</name> <name>Web Services - MokoSuiteOpenGraph</name>
<version>01.06.00</version> <version>01.06.03</version>
<creationDate>2026-05-23</creationDate> <creationDate>2026-05-23</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>
+1 -1
View File
@@ -8,7 +8,7 @@
<extension type="package" method="upgrade"> <extension type="package" method="upgrade">
<name>Package - MokoSuiteOpenGraph</name> <name>Package - MokoSuiteOpenGraph</name>
<packagename>mokoog</packagename> <packagename>mokoog</packagename>
<version>01.06.00</version> <version>01.06.03</version>
<creationDate>2026-05-23</creationDate> <creationDate>2026-05-23</creationDate>
<author>Moko Consulting</author> <author>Moko Consulting</author>
<authorEmail>hello@mokoconsulting.tech</authorEmail> <authorEmail>hello@mokoconsulting.tech</authorEmail>