Coming from #1166168: Expose a widget for filefield and imagefield, so that media browser can be used for them -- we need to respect filefield settings for display when using the widget on filefields and imagefields.
Coming from #1166168: Expose a widget for filefield and imagefield, so that media browser can be used for them -- we need to respect filefield settings for display when using the widget on filefields and imagefields.
Comments
Comment #1
aaron commentedadding tag
Comment #2
damienmckennaSubscribe.
Comment #3
yareckon commentedYay... let the grand unification begin!
Comment #4
aaron commentedthis actually already works perfectly...
Comment #5
aaron commentedno, i take it back -- if you leave 'Files displayed by default' unchecked (while checking Enable Display field), the checkbox for displaying the field is still checked when adding new content. however, then unchecking that box does indeed suppress the display.
Comment #6
aaron commentedand no, i'd forgotten to reset the widget type to media browser. none of it actually works...
Comment #7
dave reidUsing proper release blocker tag.
Comment #8
aaron commentedComment #9
aaron commentedComment #10
aaron commentedthis removes the checkboxes for display when using a media widget on a file field. note there are two forms altered: the form immediately on submit of a new file field, and its edit form.
Comment #11
aaron commentedforgot the update function.
Comment #12
aaron commentedthird try...
Comment #13
dave reidRetitling
Comment #14
aaron commentedfor reference, here are two screenshots (before & after):
becomes
Comment #15
dave reidThis patch should also remove the alt and title checkboxes from image fields as well.
Comment #16
dave reid1. We don't need $form_id parameters if we're using hook_form_FORM_ID_alter().
2. Let's save an empty update hook until the end of day if we still need it.
3. Use $form['item']['#access'] = FALSE rather than unset($form['item']);
Comment #17
robeano commentedTested successfully. 'Enable Display Field' and 'Files Displayed by Default' are no longer displayed when adding a file field or editing an existing file field in the Widget Type tab or on the Edit tab.
Comment #18
dave reidMerging in a couple of issues:
#1289860: Remove the 'Enable file description' option from file field settings if the media browser widget is used
#1201930: Hide the title and alt settings for image fields if media widget is used
Summary of items to remove:
1. File field: Enable Description field
2. File field: Enable Display field
3. File field: Files displayed by default
4. Image field: Enable Alt field
5. Image field: Enable Title field
Also make sure we apply this to 7.x-2.x first, then backport.
Comment #19
aaron commentedwaiting on arthur's update, then i'll make dave's suggested changes.
Comment #20
arthurf commentedHere's a combo patch of the three different issues minus Aaron's update hook
Comment #21
arthurf commentedComment #22
aaron commentedthis one fixes a few problems
Comment #23
shawn dearmond commentedPatch applies cleanly on 7.x-1.x. The options listed in #18 don't appear, and the field edit forms submit cleanly. A new node with those fields filled also submits cleanly and the fields display as they should.
RTBC for 1.x
Comment #24
robeano commentedTested successfully in 2.x and 1.x for File field and Image field
Comment #25
aaron commentedcommitted to 7.x-2.x and 7.x-1.x branches. thanks, everyone!
Comment #26
aaron commentedso after discussing at #D7MediaSprint i reverted the part of this patch that removed the #attached part, as other modules might add their own css or js. i tested to ensure there are no js errors after, and it works fine. here's the commit diffs for that:
7.x-2.x: http://drupalcode.org/project/media.git/commitdiff/5c84d9c?hp=1948dcce25...
7.x-1.x: http://drupalcode.org/project/media.git/commitdiff/243de55?hp=2869552b3f...
Comment #28
aaronbaumanCross-posting this support request in hopes that someone on this thread knows the answer
#1537172: Where are the "display" and "display by default" checkboxes?