Defect #39838
closed
Document model has no author field by itself
Added by salman mp 12 months ago.
Updated 11 months ago.
Description
Hi
Model Document
has no author
field and the author retreived from related attachments.
If a document has no attachment, there is no related author. For example if you sort documents by author, documents that has no attachment will not show.
- Subject changed from Modle Document has no author field by itself to Model Document has no author field by itself
- Is duplicate of Defect #6141: No data to display in Documents added
- Subject changed from Model Document has no author field by itself to Document model has no author field by itself
- Status changed from New to Closed
- Resolution set to Duplicate
salman mp wrote:
Model Document
has no author
field and the author retreived from related attachments.
That's true, indeed. And I have been bitten by this behavior several times in the past too but it seems to me that this was an intentional design decision by Jean-Philippe made long ago (first version 0.1.0). This becomes clear by e.g. comparing the Document
(source:/trunk/redmine/app/models/document.rb@4) and News
(source:/trunk/redmine/app/models/news.rb@4) models from Redmine 0.1.0.
If a document has no attachment, there is no related author. For example if you sort documents by author, documents that has no attachment will not show.
This is previously reported as #6141. As such I'll close this issue as a duplicate of it.
salman mp wrote in #note-4:
Mischa The Evil wrote in #note-3:
That's true, indeed. And I have been bitten by this behavior several times in the past too but it seems to me that this was an intentional design decision by Jean-Philippe made long ago (first version 0.1.0). This becomes clear by e.g. comparing the Document
(source:/trunk/redmine/app/models/document.rb@4) and News
(source:/trunk/redmine/app/models/news.rb@4) models from Redmine 0.1.0.
You'r right, but it seems that the design has some shortage.
I haven't said anywhere that the current design doesn't have its short-comings, flaws, etc. This is what #6141 covers IMHO.
[...] e.g in source:/trunk/app/controllers/documents_controller.rb#L41 why the last attachment's author considered as author of related document?
In this case it is behavior needed to let any document with attachments show up at all in case the list is sorted by author (like is done similarly in the acts_as_event
macro declaration for the model). Without it we effectively get the same result as reported in #6141 but then for all documents (in contrast, it now only applies to documents without any attachment).
Thanks.
After 10 years, Is there any hope that this model will be fixed? :)
Also available in: Atom
PDF