fix: add metadata field to syncpush article insert
Joomla's #__content table requires metadata column. Also send metadata from source query. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2235,24 +2235,26 @@ class MokoWaaS extends CMSPlugin implements BootableExtensionInterface
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$record = (object) [
|
||||
'title' => $item['title'] ?? '',
|
||||
'alias' => $item['alias'] ?? '',
|
||||
'introtext' => $item['introtext'] ?? '',
|
||||
'fulltext' => $item['fulltext'] ?? '',
|
||||
'state' => (int) ($item['state'] ?? 1),
|
||||
'catid' => (int) ($item['catid'] ?? 2),
|
||||
'language' => $item['language'] ?? '*',
|
||||
'featured' => (int) ($item['featured'] ?? 0),
|
||||
'metadesc' => $item['metadesc'] ?? '',
|
||||
'metakey' => $item['metakey'] ?? '',
|
||||
'created' => $item['created'] ?? $now,
|
||||
'modified' => $item['modified'] ?? $now,
|
||||
'publish_up' => $item['publish_up'] ?? $now,
|
||||
'images' => $item['images'] ?? '{}',
|
||||
'urls' => $item['urls'] ?? '{}',
|
||||
'attribs' => $item['attribs'] ?? '{}',
|
||||
'access' => (int) ($item['access'] ?? 1),
|
||||
'created_by' => 0,
|
||||
'title' => $item['title'] ?? '',
|
||||
'alias' => $item['alias'] ?? '',
|
||||
'introtext' => $item['introtext'] ?? '',
|
||||
'fulltext' => $item['fulltext'] ?? '',
|
||||
'state' => (int) ($item['state'] ?? 1),
|
||||
'catid' => (int) ($item['catid'] ?? 2),
|
||||
'language' => $item['language'] ?? '*',
|
||||
'featured' => (int) ($item['featured'] ?? 0),
|
||||
'metadesc' => $item['metadesc'] ?? '',
|
||||
'metakey' => $item['metakey'] ?? '',
|
||||
'metadata' => $item['metadata'] ?? '{}',
|
||||
'created' => $item['created'] ?? $now,
|
||||
'modified' => $item['modified'] ?? $now,
|
||||
'publish_up' => $item['publish_up'] ?? $now,
|
||||
'images' => $item['images'] ?? '{}',
|
||||
'urls' => $item['urls'] ?? '{}',
|
||||
'attribs' => $item['attribs'] ?? '{}',
|
||||
'access' => (int) ($item['access'] ?? 1),
|
||||
'created_by' => 0,
|
||||
'asset_id' => 0,
|
||||
];
|
||||
$db->insertObject('#__content', $record);
|
||||
$inserted++;
|
||||
|
||||
@@ -210,7 +210,7 @@ final class ContentSync extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('title, alias, introtext, fulltext, state, catid, language, featured, metadesc, metakey, created, modified, publish_up, images, urls, attribs, access')
|
||||
->select('title, alias, introtext, fulltext, state, catid, language, featured, metadesc, metakey, metadata, created, modified, publish_up, images, urls, attribs, access')
|
||||
->from($db->quoteName('#__content'))
|
||||
->where($db->quoteName('state') . ' >= 0');
|
||||
$db->setQuery($query);
|
||||
|
||||
Reference in New Issue
Block a user