This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Extensions » Sqliimport and multilocation
expandshrink

Sqliimport and multilocation

Sqliimport and multilocation

Monday 02 May 2011 10:21:25 am - 6 replies

Hello,

i use to work with sqliimport but i try to do multilocation and it does not succeed :

here is a part of my code which work :

$contentOptions = new SQLIContentOptions( array(
'class_identifier' => 'agence',
'remote_id' => (string)md5($row->etab."-".$row->guichet),
'creator_id' => 14
) );
$content = SQLIContent::create( $contentOptions );
$content->fields->nom_du_guichet = (string) $row->nomguichet;
$content->fields->entite = (string) $row->etab;
$content->addLocation( SQLILocation::fromNodeID( $parentnodeid ) );

$publisher = SQLIContentPublisher::getInstance();
$publisher->publish( $content );

the same with multilocation to contentroot et mediaroot doesn't work :

 

$contentOptions = new SQLIContentOptions( array(
'class_identifier' => 'agence',
'remote_id' => (string)md5($row->etab."-".$row->guichet),
'creator_id' => 14
) );
$content = SQLIContent::create( $contentOptions );
$content->fields->nom_du_guichet = (string) $row->nomguichet;
$content->fields->entite = (string) $row->etab;
$content->addLocation( SQLILocation::fromNodeID( $parentnodeid ) );
$content->addLocation( SQLILocation::fromNodeID( 2 ) );
$content->addLocation( SQLILocation::fromNodeID( 43 ) );

$publisher = SQLIContentPublisher::getInstance();
$publisher->publish( $content );

thanks a lot for your help.

Alexandre

Monday 02 May 2011 11:20:41 am

Hi Alex

It seems to be a simple right access issue. Does your import user has the right to create/edit content in the media section ?

Monday 02 May 2011 11:33:24 am

hello,

14 is the admin ....

Alexandre

Monday 02 May 2011 11:41:20 am

Yes, but there is no login action here...

Try this in your sqliimport.ini :

[ImportSettings]
RobotUserID=14

With that setting, the admin will be logged in. Without it, Anonymous User is used. The creator_id option is different. It's for forcing a user as content owner.

Monday 02 May 2011 11:48:25 am

I try to do this but nothing change ...

How the first code work with anonymous ? anonimous don't have any rights to write .... so i do'nt understand.

Alexandre

Monday 02 May 2011 12:02:38 pm

I try to do this but nothing change ...

How the first code work with anonymous ? anonimous don't have any rights to write .... so i do'nt understand.

Alexandre

When creating/editing content via script, security policies are not always checked.

Do you have anything in your logs (error.log / sqliimport logs) ?

Monday 02 May 2011 12:17:52 pm

Cool it's works.... You rock.

i 'am using : sqliimport 1.2.1 et ezpublish 4.5 community

Alexandre

Thanks ...

Modified on Tuesday 03 May 2011 1:10:59 am by Alexandre SEBBANE

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from