Task Overview:
We need to add a new field to project_issue nodes for use in uploading and storing patches and screenshots and the like.
Task Details:
* This field should be a multi-filefield.
* The new field should use it's default multiple-selector widget.
* The field should be namespaced appropriately for something that's holding files attached directly to a project_issue content type, not to a comment attached to the node.
Scope Creep?
It is not necessary to address or solve any of the UI related issues for editing a project_issue node (#1545922) within this task; Simply add a multi-file-field to the entity.
Level Of Effort
It is estimated to take 1 day of effort to complete this task.
FINISH LINE:
When a working patch is uploaded which adds a field to the project_issue content type, and that patch is tested successfully, this task will be RTBC.
Comments
Comment #1
dwwYes, we need this. ;)
I'm not sure if we want to use this issue for implementing any of the file-related fallout from #1545922: [META] Issue page redesign or just add the field, call this fixed, and move on to implement other magic in other issues. Probably just use this for the field and handle the other stuff in another issue...
Comment #2
webchickYeah, that makes sense to me. I got very distracted. :P Will try and look at this tonight.
Comment #2.0
senpai commentedAdding a level of effort to the task.
Comment #3
iamcarrico commentedI will take a look at this one... Assigning to myself... (sorry webchick)
Comment #4
webchickPerfectly fine! :D Thanks a bunch for the assist! Great to see some new faces in this issue queue. :)
Comment #5
senpai commentedTagging
Comment #6
iamcarrico commentedOkay, so I wasn't entirely certain exactly how you intended this to work, but I decided to push up a patch and see what y'all think. To test you will have to uninstall/reinstall the module, as the code lives in the install hook.
Comment #7
dwwYeah, that's definitely the basic idea. I'm not sure if all those field definitions are actually needed (or even a good idea), but I'm not sure about the internals of the Field API for crap like this, either. ;) But, my instinct is to at least try to get this to match some of the existing fields as much as possible. So, if there's stuff in here that's definitely not in the other fields, remove it and see if it still works. ;) For example, the entire 'storage' subarray seems like it definitely shouldn't be there.
Do you want to go through and compare with the other fields, or should I?
Thanks!
-Derek
Comment #8
iamcarrico commentedI will go through this today
Comment #9
iamcarrico commentedWent through and took out superfluous code.
Comment #10
mikey_p commentedLooking good, there's still a few extra and missing keys.
Under the field definition, 'entity_types' 'foreign keys' and 'indexes' aren't needed and 'cardinality' is missing (and we should probably use the FIELD_CARDINALITY_UNLIMITED constant here).
While we're at it I don't know if we want to update the allowed file types to match the current settings on d.o or try to leave it more generic. It's already somewhat specific to d.o anyway.
Comment #11
senpai commentedTagging.
Comment #12
webchickNote that this field also needs to be added to comments within the issue bundle.
Great work!
Comment #13
dwwNo, this field definitely does *not* need to be added to the comment bundle. That's the whole point of the new UI. No one will be attaching anything directly to comments.
Comment #14
webchickDuh, sorry. Brainsnafu. :P
Comment #15
iamcarrico commentedThis should address all of mikey_p s issues... there yah go!
Also--- from the beginning, I have been using the list of allowed extensions currently on d.o. This can change if needed.
Comment #16
dwwYeah, I think the extensions on d.o are a reasonable default for this.
Anyway, new patch -- back to needs review. I'll look later this morning once I've had some tea and actually wake up. ;)
Thanks!
-Derek
Comment #17
iamcarrico commentedTea is essential to any good code review...
especially some good Pu'er Tea, perfect for a morning wakeup. Anyway... let me know :-)
Comment #18
dwwCool, thanks! That was close enough. ;) I made a few final changes before committing and pushing (I'm attaching the patch of what I changed here). Basically:
- we want to use
$t()around the human-readable labels- we don't want to force specific bundles in the field definition (that's what the instance definition is for)
- reordered a few things to make the definitions more readable (put the field name and type near the top)
- we use sentence case for field labels, and in this case, I just dropped "attachments" entirely so the label is just "Files"
Thanks!
-Derek
Comment #20
iamcarrico commentedComment #20.0
iamcarrico commentedAdding a task description.