Fórum

Document Library: move entry to different folder question

Oliver Bayer, modificado 13 Anos atrás.

Document Library: move entry to different folder question

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi @all,

I have a question regarding the movement of a previously uploaded document to a new folder in Liferay 5.2.3 CE.

If someone moves a document (DLFileEntry) from one to another folder the "old" entry in dlfileentry table is deleted and a new entry is inserted which has exactly the same values besides the new folderid.

Why is always a new dlfileentry table object created instead of modifying the existing one and change the folderid??

The problem with always creating a new dlfileentry object:
You have a web content structure with a field of type document library and create a new web content with a link to a document library file. If you then move a file to another folder the link to this file isn't working anymore because the new object gets a new uuid which is used for creating the link to this file.

I changed this behaviour so that only the folderid is updated and no new dlfileentry object is created. So it's working for me now. But why is the default creating a new object in the dlfileentry table and deleting the old one (just because of a folderid change)?

Oli
Oliver Bayer, modificado 13 Anos atrás.

RE: Document Library: move entry to different folder question

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
bump
thumbnail
Sylvain ARNAUD, modificado 13 Anos atrás.

RE: Document Library: move entry to different folder question

New Member Postagens: 9 Data de Entrada: 05/01/10 Postagens Recentes
Hi Oliver,

I'm facing the same problem, with web content losing link to document library when moving a document from one folder to another.

Did you find an answer to explain the standard behavior that recreates a new document instead of updating the existing one?

Thank you.
Oliver Bayer, modificado 13 Anos atrás.

RE: Document Library: move entry to different folder question

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Sylvain,

as you can see I don't get any official response from a Liferay dev but I'm don't facing any bugs because of my change. If your interested in this modification let me know or take a look at the "DLFileEntryLocalServiceImpl.updateFileEntry" method.

Greets Oli
thumbnail
Sylvain ARNAUD, modificado 13 Anos atrás.

RE: Document Library: move entry to different folder question

New Member Postagens: 9 Data de Entrada: 05/01/10 Postagens Recentes
It appears the problem is worse in Liferay 6.
Links to document library from web content use the full path to the document.

So, if I move a document from one folder to another, links to that document are lost, even if I fix the "changed UUID" problem.

"It's not a bug, it's a feature" ?
Oliver Bayer, modificado 13 Anos atrás.

RE: Document Library: move entry to different folder question

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi,

thanks for the info.

I'm not using Liferay 6 at the moment but it's good to know that the migration wouldn't be that easy.

Can you please create a jira ticket and link this thread? Because this seems to be definetly a bug, not to say a huge bug. Moving a document should never break the links to it. Otherwise the "move document" feature is worthless.

Thanks in advance.

Oli
Sourabh Lonikar, modificado 7 Anos atrás.

RE: Document Library: move entry to different folder question

Junior Member Postagens: 42 Data de Entrada: 14/11/16 Postagens Recentes
Hi Oliver,
Can you update if any progress or further information on link breakage due to movement of documents in Liferay 6 ?

I am also interested in this issue.

Regards,
Sourabh
thumbnail
Jorge Díaz, modificado 7 Anos atrás.

RE: Document Library: move entry to different folder question

Liferay Master Postagens: 753 Data de Entrada: 09/01/14 Postagens Recentes
Liferay 6.2 don't recreate DLFileEntry unless its repositoryId/groupId changes (and that cannot be done using Liferay interface, it can only be done using Liferay API)