Foren

Document Library: move entry to different folder question

Oliver Bayer, geändert vor 13 Jahren.

Document Library: move entry to different folder question

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Document Library: move entry to different folder question

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
bump
thumbnail
Sylvain ARNAUD, geändert vor 13 Jahren.

RE: Document Library: move entry to different folder question

New Member Beiträge: 9 Beitrittsdatum: 05.01.10 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Document Library: move entry to different folder question

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Document Library: move entry to different folder question

New Member Beiträge: 9 Beitrittsdatum: 05.01.10 Neueste Beiträge
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, geändert vor 13 Jahren.

RE: Document Library: move entry to different folder question

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Document Library: move entry to different folder question

Junior Member Beiträge: 42 Beitrittsdatum: 14.11.16 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Document Library: move entry to different folder question

Liferay Master Beiträge: 753 Beitrittsdatum: 09.01.14 Neueste Beiträge
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)