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

dww’s picture

Issue tags: +project, +drupal.org D7

Yes, 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...

webchick’s picture

Yeah, that makes sense to me. I got very distracted. :P Will try and look at this tonight.

senpai’s picture

Issue summary: View changes

Adding a level of effort to the task.

iamcarrico’s picture

Assigned: webchick » iamcarrico

I will take a look at this one... Assigning to myself... (sorry webchick)

webchick’s picture

Perfectly fine! :D Thanks a bunch for the assist! Great to see some new faces in this issue queue. :)

senpai’s picture

Issue tags: +sprint 1

Tagging

iamcarrico’s picture

Status: Active » Needs review
StatusFileSize
new3.8 KB

Okay, 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.

dww’s picture

Status: Needs review » Needs work

Yeah, 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

iamcarrico’s picture

I will go through this today

iamcarrico’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB

Went through and took out superfluous code.

mikey_p’s picture

Status: Needs review » Needs work

Looking 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.

senpai’s picture

Issue tags: +sprint 2

Tagging.

webchick’s picture

Note that this field also needs to be added to comments within the issue bundle.

Great work!

dww’s picture

No, 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.

webchick’s picture

Duh, sorry. Brainsnafu. :P

iamcarrico’s picture

This 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.

dww’s picture

Status: Needs work » Needs review

Yeah, 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

iamcarrico’s picture

Tea is essential to any good code review...

especially some good Pu'er Tea, perfect for a morning wakeup. Anyway... let me know :-)

dww’s picture

Status: Needs review » Fixed
StatusFileSize
new1.71 KB

Cool, 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iamcarrico’s picture

Assigned: iamcarrico » Unassigned
iamcarrico’s picture

Issue summary: View changes

Adding a task description.