If you goto node/add/story
attach a file, set the list state to off.
It will still list the file after the initial submit.

Its a one liner.

CommentFileSizeAuthor
#9 upload.module_30.patch1.64 KBdopry
upload.module_29.patch746 bytesdopry
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Junyor’s picture

Doesn't work. Now, uploads can never be listed.

dopry’s picture

umm are you sure... I just did a clean cvs co out head... patch applied cleanly.

1) post with list enabled worked properly
a) updates worked properly

2) post with list disabled worked properly
b) updates worked properly

3) post with multiple attachments some list enabled, some not list enabled worked properly
b) updates worked properly

Are you working with or without js?

UncleD’s picture

I'm not sure I see a problem with CVS head. When I attach a file and select for it not to be listed, it doesn't show up and this is prior to applying your patch. I cant seem to produce the problem.

Junyor’s picture

Try changing list *after* the node has been submitted.

pfaocle’s picture

I can reproduce this on beta2 and HEAD, and Junyor, that is not a solution, that is the problem dopry has raised.

I will try the patch at some point, once I've finished wrestling with these damn resizable text-areas. >:|

pfaocle’s picture

Patch works great, at least for beta2.

Junyor’s picture

Status: Needs review » Needs work

I wasn't posting a solution, I was posting about how to reproduce a bug with this patch. Let me be more verbose:

Reproduction:
1) Submit a node with the list attribute of a file disabled
2) Edit the node
3) Enable list attribute of the file
4) Submit the node

Expected result:
1) The file should now be listed when viewing the node
2) The list attribute should be checked when the node is edited

Actual result:
1) The file is not listed when viewing the node
2) The list attribute is not checked when the node is edited

The problem also appears if the list attribute was initially enabled and you try to disable it.

In other words, with this patch, it's impossible to change the list attribute after the node has been submitted.

Junyor’s picture

Status: Needs work » Reviewed & tested by the community

It looks like that's a problem when creating new revisions. With revisions disabled, this patch works as advertised. Note that the problem I'm seeing happens without this patch too. Thus, this patch fixes a bug, though other bugs exist.

dopry’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.64 KB

Junyor pointed out the revision issue, and the other query I needed to patch...
Tested it, so here it is all rolled together against HEAD.

Junyor’s picture

Status: Needs review » Reviewed & tested by the community

Tested with and without revisions. Works as advertised.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)