joomla-projects / soc23_joomla-converter

GNU General Public License v2.0
8 stars 6 forks source link

Migrate post to joomla #29

Open joomlablr opened 2 days ago

joomlablr commented 2 days ago

If we migrate post and articles to joomla, in admin parts we don`t see any articles, while in DB (phpmyadmin) we see all of this. We need add this article to table #__workflow_associations - near 993 rows in Wordpress.php in plugins

            //old parts with article
            $article->language = '*';
            $article->note = "";

            //new part code for  workflow
            $workflow = new stdClass();
            $workflow->item_id = $articleid;
            $workflow->stage_id = 1;
            $workflow->extension = "com_content.article"; 

            $jdb = Factory::getDbo()->insertObject($tablePrefix . 'content', $article);

//new code for write worklow tables
            $jdb = Factory::getDbo()->insertObject($tablePrefix . 'workflow_associations', $workflow);

And i think we need create the same for asset table

    ```
        $asset = Table::getInstance('Asset', 'JTable', array('dbo' => $db));
        $assets = new stdClass();
        $assets->parent_id = $parentAssetId; // ID parent element
        $assets->name = "com_content.article".$articleid;
        $assets->title = $row['post_title']; // this must be article title
        $assets->rules = '{}';

if (!$asset->store()) { throw new Exception($asset->getError()); } $jdb = Factory::getDbo()->insertObject($tablePrefix . 'assets', $assets);



And next one - this is error with migrates users. Now we need come back and do it again - than  we migrate user. And in articles created_by  user is wrong. Can we something do with it?
joomlablr commented 2 days ago

and something happens with categories - all is unpublished and i dont see any articles in this categories. When i go to same category and tru public and save - i have an errorSave failed with the following error: Joomla\Component\Categories\Administrator\Table\CategoryTable::moveByReference() is trying to make record ID 9 a child of itself.