Comments

aaron’s picture

Issue tags: +Release blocker

adding tag

damienmckenna’s picture

Subscribe.

yareckon’s picture

Yay... let the grand unification begin!

aaron’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

this actually already works perfectly...

aaron’s picture

Status: Fixed » Active

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

aaron’s picture

and no, i'd forgotten to reset the widget type to media browser. none of it actually works...

dave reid’s picture

Using proper release blocker tag.

aaron’s picture

Assigned: Unassigned » aaron
aaron’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB
aaron’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev

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

aaron’s picture

forgot the update function.

aaron’s picture

third try...

dave reid’s picture

Title: Respect filefield settings for display » Hide the 'display' settings for file fields if the media widget is used

Retitling

aaron’s picture

for reference, here are two screenshots (before & after):

before

becomes

after

dave reid’s picture

This patch should also remove the alt and title checkboxes from image fields as well.

dave reid’s picture

1. 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']);

robeano’s picture

Status: Needs review » Reviewed & tested by the community

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

dave reid’s picture

Title: Hide the 'display' settings for file fields if the media widget is used » Hide field and widget settings that the media widget cannot support
Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs review

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

aaron’s picture

Status: Needs review » Needs work

waiting on arthur's update, then i'll make dave's suggested changes.

arthurf’s picture

StatusFileSize
new2.54 KB

Here's a combo patch of the three different issues minus Aaron's update hook

arthurf’s picture

Status: Needs work » Needs review
aaron’s picture

this one fixes a few problems

shawn dearmond’s picture

Patch 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

robeano’s picture

Status: Needs review » Reviewed & tested by the community

Tested successfully in 2.x and 1.x for File field and Image field

aaron’s picture

Status: Reviewed & tested by the community » Fixed

committed to 7.x-2.x and 7.x-1.x branches. thanks, everyone!

aaron’s picture

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

Status: Fixed » Closed (fixed)

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

aaronbauman’s picture

Cross-posting this support request in hopes that someone on this thread knows the answer
#1537172: Where are the "display" and "display by default" checkboxes?