This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
Announcement: Please use Github, to report any new issue or pull request.
None
Givx - RG
2013-10-31

Add option for the importer for the update, because for the moment it's already id of #__content. I need to params the field check for the update. It's return the id of the content and update it's applicate. 

For the moment i have add if id it's not present in the csv, i check if have a column alias for check update. 

I modified this file cck_storage_location/joomla_article/importer.php at ligne 29 : 

                        if($isNew)

                        {

                            $table  =   self::_getTableByAlias($data);

                            $isNew  =   ($table === null ) ? $isNew : false;

                        }

And add this function in the same file in the class : 

        public static function _getTableByAlias($data)

        {

            $alias  =   JApplication::stringURLSafe($data['alias']);

           

            $db     =   JFactory::getDbo();

            $query  =   $db->getQuery(true);

            $query->select('id')

                    ->from(self::$table)

                    ->where($db->quoteName('alias').'='.$db->quote($alias));

            $db->setQuery($query);

            $pk =   $db->loadResult();

           

            if($pk === null) return null;

            else

            {

$table=JTable::getInstance( 'content' );

if ( $pk > 0 ) {

$table->load( $pk );

if ( $table->id ) {

if ( $join ) { // todo:join

$join=JCckDatabase::loadObject( 'SELECT a.title, a.alias FROM #__categories AS a WHERE a.id = '.$table->catid );//@

$table->category_title=$join->title;

$table->category_alias=$join->alias;

}

if ( JCck::on( '3.1' ) ) {

$table->tags=new JHelperTags;

$table->tags->getTagIds( $table->id, 'com_content.article' );

}

}

}

return $table;                

            }

        }


Need some help?

Comments