Skip to content
This repository was archived by the owner on Aug 14, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sites/all/modules/contrib/commons/.drush-lock-update
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Locked via drush.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ core = 7.x

dependencies[] = block

; Information added by Drupal.org packaging script on 2017-02-06
version = "7.x-3.42"
; Information added by Drupal.org packaging script on 2017-02-27
version = "7.x-3.43"
core = "7.x"
project = "commons"
datestamp = "1486411089"
datestamp = "1488210216"

2 changes: 1 addition & 1 deletion sites/all/modules/contrib/media/includes/media.fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function media_field_widget_form(&$form, &$form_state, $field, $instance, $langc
elseif (module_exists('translation') && $element['#entity_type'] == 'node' && translation_supported_type($element['#entity']->type)) {
$element['#media_parent_entity_form_langcode'] = $element['#entity']->language;
$element['#media_parent_entity_source_langcode'] = $element['#entity']->language;
} elseif ($element['#entity_type'] == 'field_collection_item' && property_exists($form['#entity'], 'language')) {
} elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
$element['#media_parent_entity_form_langcode'] = $form['#entity']->language;
}

Expand Down
6 changes: 3 additions & 3 deletions sites/all/modules/contrib/media/media.info
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ configure = admin/config/media/browser
; We have to add a fake version so Git checkouts do not fail Media dependencies
version = 7.x-2.x-dev

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

7 changes: 6 additions & 1 deletion sites/all/modules/contrib/media/media.install
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,12 @@ function media_update_7208() {
// Merge existing type with new ones.
if ($new_type = file_type_load($type->name)) {
$new_type->mimetypes = array_merge($type->mimetypes, $new_type->mimetypes);
$new_type->streams = array_merge($type->streams, $new_type->streams);
if (!empty($new_type->streams)) {
$new_type->streams = array_merge($type->streams, $new_type->streams);
}
else{
$new_type->streams = $type->streams;
}
}
else {
$new_type = $type;
Expand Down
7 changes: 6 additions & 1 deletion sites/all/modules/contrib/media/media.module
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,16 @@ function media_element_process($element, &$form_state, $form) {
// Media browser attach code.
$element['#attached']['js'][] = drupal_get_path('module', 'media') . '/js/media.js';

// IDs of form elements are 'unstable' in Drupal because of drupal_html_id
// add a class for our Javascript instead.
$element_js_class = drupal_html_class('js-media-element-' . $element['#id']);
$element['upload']['#attributes']['class'][] = $element_js_class;

// Add the media options to the page as JavaScript settings.
$element['browse_button']['#attached']['js'] = array(
array(
'type' => 'setting',
'data' => array('media' => array('elements' => array('#' . $element['#id'] => $element['#media_options'])))
'data' => array('media' => array('elements' => array('.' . $element_js_class => $element['#media_options'])))
)
);

Expand Down
2 changes: 1 addition & 1 deletion sites/all/modules/contrib/media/media.views.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function media_views_plugins() {
if (module_exists('search_api')) {
// If the Search API module exists, also allow indices of the file-entity
// that has the fid field indexed.
$indices = search_api_index_load_multiple(NULL);
$indices = search_api_index_load_multiple(FALSE);
foreach ($indices as $machine_name => $index) {
if ($index->item_type == 'file' && isset($index->options['fields']['fid'])) {
$base[] = 'search_api_index_' . $machine_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ test_dependencies[] = plupload
files[] = includes/MediaBrowserBulkUpload.inc
files[] = tests/media_bulk_upload.test

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ files[] = includes/MediaInternetNoHandlerException.inc
files[] = includes/MediaInternetValidationException.inc
files[] = tests/media_internet.test

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ hidden = TRUE
files[] = includes/MediaInternetTestStreamWrapper.inc
files[] = includes/MediaInternetTestHandler.inc

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ dependencies[] = media

configure = admin/structure/file-types/upgrade

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function media_wysiwyg_filter_field_parser($tag_info) {
}
}
// Multi-value select lists show up here with 3 array items.
elseif (count($parsed_field) == 3 && is_numeric($parsed_field[2])) {
elseif (count($parsed_field) == 3 && (empty($parsed_field[2]) || is_numeric($parsed_field[2]))) {
$info = field_info_field($parsed_field[0]);
// They just need the value column.
$parsed_field[3] = key($info['columns']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
$(mediaElements).each(function (i) {
// Attempt to derive a JSON macro representation of the media placeholder.
// Note: Drupal 7 ships with JQuery 1.4.4, which allows $(this).attr('outerHTML') to retrieve the eement's HTML,
// but many sites use JQuery update to increate this to 1.6+, which insists on $(this).prop('outerHTML).
// Until the minimum jQuery is >= 1.6, we need to do this the old-school way.
// but many sites use JQuery update to increate this to 1.6+, which insists on $(this).prop('outerHTML).
// Until the minimum jQuery is >= 1.6, we need to do this the old-school way.
// See http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html
var markup = $(this).get(0).outerHTML;
if (markup === undefined) {
Expand Down Expand Up @@ -291,6 +291,8 @@
}
element.addClass(classes.join(' '));

// Attempt to override the link_title if the user has chosen to do this.
info.link_text = this.overrideLinkTitle(info);
// Apply link_text if present.
if (info.link_text) {
$('a', element).html(info.link_text);
Expand All @@ -309,6 +311,7 @@
var file_info = Drupal.media.filter.extract_file_info(element);
if (file_info) {
if (typeof file_info.link_text == 'string') {
file_info.link_text = this.overrideLinkTitle(file_info);
// Make sure the link_text-html-tags are properly escaped.
file_info.link_text = file_info.link_text.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
Expand Down Expand Up @@ -430,29 +433,60 @@
return Drupal.settings.tagmap;
},

/**
* Return the overridden link title based on the file_entity title field
* set.
* @param file the file object.
* @returns the overridden link_title or the existing link text if no
* overridden.
*/
overrideLinkTitle: function(file) {
var file_title_field = Drupal.settings.media.img_title_field.replace('field_', '');
var file_title_field_machine_name = '';
if (typeof(file.fields) != 'undefined') {
jQuery.each(file.fields, function(field, fieldValue) {
if (field.indexOf(file_title_field) != -1) {
file_title_field_machine_name = field;
}
});

if (typeof(file.fields[file_title_field_machine_name]) != 'undefined' && file.fields[file_title_field_machine_name] != '') {
return file.fields[file_title_field_machine_name];
}
else {
return file.link_text;
}
}
else {
return file.link_text;
}
},

/**
* Generates a unique "delta" for each embedding of a particular file.
*/
fileEmbedDelta: function(fid, element) {
// Ensure we have an object to track our deltas.
Drupal.settings.mediaDeltas = Drupal.settings.mediaDeltas || {};
Drupal.settings.maxMediaDelta = Drupal.settings.maxMediaDelta || 0;

// Check to see if the element already has one.
if (element && element.data('delta')) {
var existingDelta = element.data('delta');
// If so, make sure that it is being tracked in mediaDeltas.
if (!Drupal.settings.mediaDeltas[fid]) {
Drupal.settings.mediaDeltas[fid] = existingDelta;
// If so, make sure that it is being tracked in mediaDeltas. If we're
// going to create new deltas later on, make sure they do not overwrite
// other mediaDeltas.
if (!Drupal.settings.mediaDeltas[existingDelta]) {
Drupal.settings.mediaDeltas[existingDelta] = fid;
Drupal.settings.maxMediaDelta = Math.max(Drupal.settings.maxMediaDelta, existingDelta);
}
return existingDelta;
}
// Otherwise, generate a new one. Arbitrarily start with 1.
var delta = 1;
if (Drupal.settings.mediaDeltas[fid]) {
delta = Drupal.settings.mediaDeltas[fid] + 1;
}
Drupal.settings.mediaDeltas[fid] = delta;
return delta;
// Otherwise, generate a new one.
var newDelta = Drupal.settings.maxMediaDelta + 1;
Drupal.settings.mediaDeltas[newDelta] = fid;
Drupal.settings.maxMediaDelta = newDelta;
return newDelta;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ files[] = tests/media_wysiwyg.macro.test

configure = admin/config/media/browser

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Install, update and uninstall functions for the Media WYSIWYG module.
*/

/**
/**
* Implements hook_schema().
*/
function media_wysiwyg_schema() {
Expand Down Expand Up @@ -125,6 +125,7 @@ function media_wysiwyg_update_7203() {

return $output;
}

/**
* Whitelists certain fields for WYSIWYG overriding.
*/
Expand Down Expand Up @@ -170,30 +171,36 @@ function media_wysiwyg_update_7205() {

// Create the new configuration tables.
if (!db_table_exists('media_restrict_wysiwyg')) {
db_create_table('media_restrict_wysiwyg', $schema['media_restrict_wysiwyg']);
db_create_table('media_restrict_wysiwyg', $schema['media_restrict_wysiwyg']);
db_create_table('media_view_mode_wysiwyg', $schema['media_view_mode_wysiwyg']);
}

// Migrate the configuration from the old variables into the new DB tables.
$types = file_type_load_all(TRUE);
foreach ($types as $type) {
$wysiwyg_restricted_view_modes = variable_get("media_wysiwyg_view_mode_{$type->type}_wysiwyg_restricted_view_modes", array());
foreach ($wysiwyg_restricted_view_modes as $wysiwyg_restricted_view_mode) {
db_insert('media_restrict_wysiwyg')
$enabled = variable_get("media_wysiwyg_view_mode_" . $type->type . "_file_wysiwyg_restricted_view_modes_status", FALSE);
if ($enabled) {
$wysiwyg_restricted_view_modes = variable_get("media_wysiwyg_view_mode_" . $type->type . "_file_wysiwyg_restricted_view_modes", array());
foreach ($wysiwyg_restricted_view_modes as $wysiwyg_restricted_view_mode) {
db_insert('media_restrict_wysiwyg')
->fields(array(
'type' => $type->type,
'display' => $wysiwyg_restricted_view_mode,
))
->execute();
}
}

$enabled = variable_get("media_wysiwyg_view_mode_" . $type->type . "_wysiwyg_view_mode_status", FALSE);
if ($enabled) {
$file_wysiwyg_view_mode = variable_get("media_wysiwyg_view_mode_" . $type->type . "_file_wysiwyg_view_mode", 'wysiwyg');
db_insert('media_view_mode_wysiwyg')
->fields(array(
'type' => $type->type,
'display' => $wysiwyg_restricted_view_mode,
'view_mode' => $file_wysiwyg_view_mode,
))
->execute();
}

$file_wysiwyg_view_mode = variable_get("media_wysiwyg_view_mode_{$type->type}_file_wysiwyg_view_mode", 'wysiwyg');
db_insert('media_view_mode_wysiwyg')
->fields(array(
'type' => $type->type,
'view_mode' => $file_wysiwyg_view_mode,
))
->execute();
}

// Remove old configuration variables.
Expand Down Expand Up @@ -233,7 +240,5 @@ function media_wysiwyg_update_7205() {
*/
function media_wysiwyg_update_7206() {
$message = t('If you would like to be able to align your embedded media (left, right, or center), go to /admin/config/media/browser and check "Provide alignment option when embedding media", and save the settings.');
drupal_set_message($message,'warning',TRUE);
drupal_set_message($message, 'warning', TRUE);
}


Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ description = DEPRECATED, this folder is only here so that the module can be uni
package = Media
core = 7.x

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ package = Media
core = 7.x
dependencies[] = media

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

2 changes: 1 addition & 1 deletion sites/all/modules/contrib/media/tests/media.test
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ class MediaElementSettingsTestCase extends MediaFileFieldTestCase {
$multiselect = ($field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED);
$field_widget = array(
'elements' => array(
'#edit-' . $field_name . '-' . LANGUAGE_NONE . '-0-upload' => array(
'.js-media-element-edit-' . $field_name . '-' . LANGUAGE_NONE . '-0-upload' => array(
'global' => array(
'types' => array(
'image' => 'image',
Expand Down
6 changes: 3 additions & 3 deletions sites/all/modules/contrib/media/tests/media_module_test.info
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ hidden = TRUE

files[] = includes/MediaModuleTest.inc

; Information added by Drupal.org packaging script on 2017-02-03
version = "7.x-2.0-rc5"
; Information added by Drupal.org packaging script on 2017-03-05
version = "7.x-2.0-rc12"
core = "7.x"
project = "media"
datestamp = "1486142925"
datestamp = "1488724088"

Loading