Forums / Developer / Node's Url alias creation error

Node's Url alias creation error

Author Message

H-Works Agency

Monday 30 May 2011 8:32:42 am

Hello everyone,

I experienced that when you have a tree with multiple import cronjobs that do a lot of edit/delete/create you end up with a lot of node missing their "url_alias".

I know my report isn't very precise but has someone already experienced this problem ?

Is there a special command to execute after for example createAndPublish or updateAndPublish to prevent ending with /content/view/full/28348 url's ?

I know that bin/php/updateniceurl.php can do the job but what could be the cause of those missing aliases ?

Thanx in advance.

EZP is Great

Nicolas Pastorino

Tuesday 31 May 2011 12:43:02 am

Hi Martin, 

I'd say re-publishing the content should do the deal (eg : execute the 'content' 'publish' operation anew, from PHP). Might need to be trimmed in case of large volumes. DelayedIndexing has to be enabled, at least in memory only.

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Marko Žmak

Tuesday 31 May 2011 1:55:32 am

Maybe using something like this:

                $operationResult = eZOperationHandler::execute(
                        'content', 'publish',
                        array(
                                'object_id' => $object->attribute( 'id' ),
                                'version' => $version->attribute( 'version' )
                        )
                );

in the import script would do the trick?

I used it in many import scripts and never had problems with url aliases.

P.S. For faster imports look at the discussion in this forum thread:

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

H-Works Agency

Tuesday 31 May 2011 2:12:42 am

Uhm thank you, i'll replace my createAndPublish with the execute method on content publish to see what happens.

EZP is Great