From 67b77dfa40e378f583def1f2895df2adf8675025 Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Wed, 2 Jan 2019 13:14:14 -0500 Subject: [PATCH 01/10] add resource_language_code --- dlts_viewer.module | 13 ++++++++++++- inc/types/book.inc | 34 +++++++++++++++++++--------------- inc/utils.inc | 28 +++++++++++++++++++++++++++- templates/html.tpl.php | 3 +-- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/dlts_viewer.module b/dlts_viewer.module index b066695c..b6cd6c2a 100755 --- a/dlts_viewer.module +++ b/dlts_viewer.module @@ -119,7 +119,7 @@ function dlts_viewer_preprocess_html(&$vars) { // see html.tpl.php $vars['pane_metadata_hidden'] = ''; /** The Viewer sets language direction in the markup */ - $vars['language_dir'] = dlts_viewer_viewer_language($vars); + $vars['language_dir'] = dlts_viewer_viewer_language($vars); /** we are not in admin page, default Viewer HTML template */ $vars['theme_hook_suggestions'][] = 'html__viewer'; $vars['classes_array'][] = 'yui3-skin-sam'; @@ -138,6 +138,17 @@ function dlts_viewer_preprocess_html(&$vars) { else { $vars['classes_array'][] = 'not_mobile'; } + + // See: https://jira.nyu.edu/jira/browse/DLTSVIEWER-81 + $language_default = language_default(); + $vars['resource_language_code'] = $language_default->language; + // We have access to $resource_language_code in the global context + // if the resource exist. + // See: dlts_viewer_dispatcher() + $resource_language_code = dlts_viewer_resource_language_code(); + if ($resource_language_code) { + $vars['resource_language_code'] = $resource_language_code; + } /** * We use Drupal to render objects from MongoDB that don't have a record register diff --git a/inc/types/book.inc b/inc/types/book.inc index 229a7b87..d6e15709 100755 --- a/inc/types/book.inc +++ b/inc/types/book.inc @@ -171,7 +171,11 @@ function dlts_viewer_dispatcher($entity, $arg) $pdf_is_searchable = dlts_viewer_pdf_is_searchable($entity); // test if resource $is_resource = dlts_viewer_is_resource(); -// check request type + + if ($is_resource) { + dlts_viewer_resource_language_code($entity); + } + // check request type $is_pjax = dlts_viewer_is_pjax(); // check for mobile devices $is_mobile = dlts_viewer_is_mobile(); @@ -188,20 +192,20 @@ function dlts_viewer_dispatcher($entity, $arg) // change entity title $entity->title = t('@title @volume', array('@title' => $multivolume_book->title, '@volume' => $volume_number_str)); } -// check if this books is part of a series -// $series_book = dlts_viewer_is_series_book($entity); -// not sure if this is right. the book can part of multiple series book -// figure out the right way to pick the title -// maybe we can do something along the lines of: Book Title (also known as Series book title 1, Series book title 2) -//if ($entity->isSeriesBook) { -//dpm($entity->seriesBook); -//foreach ($entity->seriesBook as $series_book) { -// for now just get the last one (since we just have one for now) -// talk about this with the group and fix later. -//$entity->title = $series_book['volume_label']; -//} -//} -// set entity title + + // check if this books is part of a series + // $series_book = dlts_viewer_is_series_book($entity); + // not sure if this is right. the book can part of multiple series book + // figure out the right way to pick the title + // maybe we can do something along the lines of: Book Title (also known as Series book title 1, Series book title 2) + //if ($entity->isSeriesBook) { + //foreach ($entity->seriesBook as $series_book) { + // for now just get the last one (since we just have one for now) + // talk about this with the group and fix later. + //$entity->title = $series_book['volume_label']; + //} + //} + // set entity title drupal_set_title($entity->title); // wrapp book entity with Entity API wrapper $book_wrapper = entity_metadata_wrapper('node', $entity); diff --git a/inc/utils.inc b/inc/utils.inc index dedb1e75..923590a4 100644 --- a/inc/utils.inc +++ b/inc/utils.inc @@ -166,7 +166,7 @@ function dlts_viewer_is_mobile() { } /** - * See http://mobiledetect.net/ + * See http://mobiledetect.net/ */ function dlts_viewer_mobile_detect() { try { @@ -216,6 +216,32 @@ function dlts_viewer_is_embed() { return $is_embed; } +/** + * return language code of the resource (if available) + */ +function dlts_viewer_resource_language_code($vars = NULL) { + $resource_language_code = &drupal_static('resource_language_code'); + if (!isset($resource_language_code)) { + if (!empty($vars) && gettype($vars) == 'object') { + // as of today, books are the only resource with the field `field_language_code` + if ($vars->type == 'dlts_book') { + $wrapper = entity_metadata_wrapper('node', $vars); + $field_language_code = $wrapper->field_language_code->value(); + if ($field_language_code) { + // Field allows unlimited number of values. This seem wrong. Shifts the first value + // of the array off and returns it + // See: admin/structure/types/manage/dlts-book/fields/field_language_code + $resource_language_code = array_shift($field_language_code); + } + } + } + } + return $resource_language_code; +} + +/** + * return language direction of the resource + */ function dlts_viewer_viewer_language($vars = NULL) { $viewer_language = &drupal_static('viewer_language'); if (!isset($viewer_language)) { diff --git a/templates/html.tpl.php b/templates/html.tpl.php index e065a7b3..28fc4e3f 100755 --- a/templates/html.tpl.php +++ b/templates/html.tpl.php @@ -1,5 +1,5 @@ - + <?php print $head_title ?> @@ -21,4 +21,3 @@ - From ede72f187671d105074a1f6a210267cd225d0aec Mon Sep 17 00:00:00 2001 From: vagrant Date: Fri, 27 Mar 2020 21:10:15 +0000 Subject: [PATCH 02/10] update ignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4aa1f645..e7d652d1 100755 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,9 @@ # Ignore Intellij/PHPStorm/WebStorm files *.iml -node_modules +js/node_modules +./*.sql +./*.json # Ignore editor backup files *~ From 7ccf6630b3423a31872395e672672ed186aae442 Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Fri, 27 Mar 2020 17:11:10 -0400 Subject: [PATCH 03/10] update ignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e7d652d1..64eaedc8 100755 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ *.iml js/node_modules -./*.sql -./*.json +*.sql +*.json # Ignore editor backup files *~ From 0738f5c3276ff4cf90c85524e705a5b2017c3e58 Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Fri, 27 Mar 2020 18:42:20 -0400 Subject: [PATCH 04/10] DLTSVIEWER-95 --- dlts_viewer.module | 5 ++++- inc/themes.inc | 12 +++++++----- inc/types/book.inc | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dlts_viewer.module b/dlts_viewer.module index b6cd6c2a..3f3e49d4 100755 --- a/dlts_viewer.module +++ b/dlts_viewer.module @@ -283,7 +283,10 @@ function dlts_viewer_flush_caches() { t('PDF'); t('High-resolution'); t('Low-resolution'); - t('Vol.'); + t('Vol.'); + t('Download'); + t('High resolution PDF'); + t('Low resolution PDF '); } // here we need to make sure we delete the record from Apache Solr diff --git a/inc/themes.inc b/inc/themes.inc index 57eaca29..6370f8f0 100755 --- a/inc/themes.inc +++ b/inc/themes.inc @@ -477,10 +477,11 @@ function theme_field__field_pdf_file (&$variables) { if ($variables['element']['#view_mode'] == 'metadata') { $out .= '
'; - $out .= '
Download:
'; + $out .= '
' . locale('Download', NULL, $variables['element']['#object']->language) . ':
'; foreach ($variables['items'] as $key => $item) { $out .= '
'; - $out .= ''; } diff --git a/inc/types/book.inc b/inc/types/book.inc index d6e15709..c75ce618 100755 --- a/inc/types/book.inc +++ b/inc/types/book.inc @@ -138,10 +138,10 @@ function _language_field(&$entity) $languages = $languages[1]; $entity->lang_dir = (!isset($languages[$entity->language]->direction) || isset($languages[$entity->language]->direction) && $languages[$entity->language]->direction == 0) ? 'ltr' : 'rtl'; $entity->lang_language = isset($languages[$entity->language]->language) ? $languages[$entity->language]->language : 'en'; - $entity->lang_name = isset($languages[$entity->language]->name) ? $languages[$entity->language]->name : 'English'; + $entity->lang_name = isset($languages[$entity->language]->name) ? $languages[$entity->language]->name : t('English'); $translations = translation_path_get_translations('node/' . $entity->nid); if (count($translations) > 1) { - $entity->lang_options = array('#type' => 'markup', '#prefix' => '', '#markup' => ''); + $entity->lang_options = array('#type' => 'markup', '#prefix' => '', '#markup' => ''); foreach ($translations as $key => $index) { $url = url('books/' . $entity->identifier . '/display', array('absolute' => true, 'query' => array('lang' => $key))); $markup = array( From 4c96a9e5c465ca57497d459eec9c0b6da9d68c53 Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Fri, 27 Mar 2020 19:31:44 -0400 Subject: [PATCH 05/10] change replace to assign and make sure the language flag is passed when changing from one book to another using the MV event --- js/ui.components.yui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui.components.yui.js b/js/ui.components.yui.js index a324304b..9efe4be1 100644 --- a/js/ui.components.yui.js +++ b/js/ui.components.yui.js @@ -551,10 +551,11 @@ YUI().use( e.halt(); var currentTarget = e.currentTarget; var value = currentTarget.one(':checked').get('value'); - var url = value.substring(value.indexOf('::') + 2, value.length); + var lang = Y.one('.node-dlts-book').getAttribute('data-lang'); + var url = value.substring(value.indexOf('::') + 2, value.length) + '/1?lang=' + lang; var data = { url : url }; if (window.self === window.top) { - window.location.replace(url); + window.location.assign(url) } else { Y.CrossFrame.postMessage('parent', JSON.stringify({ fire: 'change:option:multivolume', data })); From 6469d183005e493994f5d9266e519a26adbfc200 Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Fri, 27 Mar 2020 20:19:34 -0400 Subject: [PATCH 06/10] added language map --- inc/utils.inc | 198 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 1 deletion(-) diff --git a/inc/utils.inc b/inc/utils.inc index 923590a4..95cd4e08 100644 --- a/inc/utils.inc +++ b/inc/utils.inc @@ -231,7 +231,8 @@ function dlts_viewer_resource_language_code($vars = NULL) { // Field allows unlimited number of values. This seem wrong. Shifts the first value // of the array off and returns it // See: admin/structure/types/manage/dlts-book/fields/field_language_code - $resource_language_code = array_shift($field_language_code); + $code = array_shift($field_language_code); + $resource_language_code = mapLanguageCode($code); } } } @@ -319,3 +320,198 @@ function return_page_nodeids_json($dlts_id) { drupal_json_output((object) $nodeids); exit; } + +// This is MAP from ISO 639-1 to ISO 639-2/B as described in the standard +// http://www.loc.gov/standards/iso639-2/php/code_list.php +function mapLanguageCode($lang = 'eng') { + $MAPISO639 = array( + "aar" => "aa", + "abk" => "ab", + "afr" => "af", + "aka" => "ak", + "alb" => "sq", + "amh" => "am", + "ara" => "ar", + "arg" => "an", + "arm" => "hy", + "asm" => "as", + "ava" => "av", + "ave" => "ae", + "aym" => "ay", + "aze" => "az", + "bak" => "ba", + "bam" => "bm", + "baq" => "eu", + "bel" => "be", + "ben" => "bn", + "bih" => "bh", + "bis" => "bi", + "bos" => "bs", + "bre" => "br", + "bul" => "bg", + "bur" => "my", + "cat" => "ca", + "cha" => "ch", + "che" => "ce", + "chi" => "zh", + "chu" => "cu", + "chv" => "cv", + "cor" => "kw", + "cos" => "co", + "cre" => "cr", + "cze" => "cs", + "dan" => "da", + "div" => "dv", + "dut" => "nl", + "dzo" => "dz", + "eng" => "en", + "epo" => "eo", + "est" => "et", + "ewe" => "ee", + "fao" => "fo", + "fij" => "fj", + "fin" => "fi", + "fre" => "fr", + "fry" => "fy", + "ful" => "ff", + "geo" => "ka", + "ger" => "de", + "gla" => "gd", + "gle" => "ga", + "glg" => "gl", + "glv" => "gv", + "gre" => "el", + "grn" => "gn", + "guj" => "gu", + "hat" => "ht", + "hau" => "ha", + "heb" => "he", + "her" => "hz", + "hin" => "hi", + "hmo" => "ho", + "hrv" => "hr", + "hun" => "hu", + "ibo" => "ig", + "ice" => "is", + "ido" => "io", + "iii" => "ii", + "iku" => "iu", + "ile" => "ie", + "ina" => "ia", + "ind" => "id", + "ipk" => "ik", + "ita" => "it", + "jav" => "jv", + "jpn" => "ja", + "kal" => "kl", + "kan" => "kn", + "kas" => "ks", + "kau" => "kr", + "kaz" => "kk", + "khm" => "km", + "kik" => "ki", + "kin" => "rw", + "kir" => "ky", + "kom" => "kv", + "kon" => "kg", + "kor" => "ko", + "kua" => "kj", + "kur" => "ku", + "lao" => "lo", + "lat" => "la", + "lav" => "lv", + "lim" => "li", + "lin" => "ln", + "lit" => "lt", + "ltz" => "lb", + "lub" => "lu", + "lug" => "lg", + "mac" => "mk", + "mah" => "mh", + "mal" => "ml", + "mao" => "mi", + "mar" => "mr", + "may" => "ms", + "mlg" => "mg", + "mlt" => "mt", + "mon" => "mn", + "nau" => "na", + "nav" => "nv", + "nbl" => "nr", + "nde" => "nd", + "ndo" => "ng", + "nep" => "ne", + "nno" => "nn", + "nob" => "nb", + "nor" => "no", + "nya" => "ny", + "oci" => "oc", + "oji" => "oj", + "ori" => "or", + "orm" => "om", + "oss" => "os", + "pan" => "pa", + "per" => "fa", + "pli" => "pi", + "pol" => "pl", + "por" => "pt", + "pus" => "ps", + "que" => "qu", + "roh" => "rm", + "rum" => "ro", + "run" => "rn", + "rus" => "ru", + "sag" => "sg", + "san" => "sa", + "sin" => "si", + "slo" => "sk", + "slv" => "sl", + "sme" => "se", + "smo" => "sm", + "sna" => "sn", + "snd" => "sd", + "som" => "so", + "sot" => "st", + "spa" => "es", + "srd" => "sc", + "srp" => "sr", + "ssw" => "ss", + "sun" => "su", + "swa" => "sw", + "swe" => "sv", + "tah" => "ty", + "tam" => "ta", + "tat" => "tt", + "tel" => "te", + "tgk" => "tg", + "tgl" => "tl", + "tha" => "th", + "tib" => "bo", + "tir" => "ti", + "ton" => "to", + "tsn" => "tn", + "tso" => "ts", + "tuk" => "tk", + "tur" => "tr", + "twi" => "tw", + "uig" => "ug", + "ukr" => "uk", + "urd" => "ur", + "uzb" => "uz", + "ven" => "ve", + "vie" => "vi", + "vol" => "vo", + "wel" => "cy", + "wln" => "wa", + "wol" => "wo", + "xho" => "xh", + "yid" => "yi", + "yor" => "yo", + "zha" => "za", + "zul" => "zu", + ); + if (strlen($lang) == 3 && isset($MAPISO639[$lang])) { + return $MAPISO639[$lang]; + } + return 'en'; + } \ No newline at end of file From 9883e82d5e3f1c2d28dfb676f68c7a183c0f5ba3 Mon Sep 17 00:00:00 2001 From: Ekaterina Pechekhonova Date: Sun, 29 Mar 2020 19:32:18 -0400 Subject: [PATCH 07/10] Added array check for multivolume book --- drush/inc/create.dlts_multivol_book.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drush/inc/create.dlts_multivol_book.inc b/drush/inc/create.dlts_multivol_book.inc index 700c779f..940e74f5 100755 --- a/drush/inc/create.dlts_multivol_book.inc +++ b/drush/inc/create.dlts_multivol_book.inc @@ -111,11 +111,10 @@ function create_dlts_multivol_book($node) { $multivol_exist = multivol_nid($node->isPartOf->identifier); } + if ($multivol_exist) { - $ewrapper->field_multivol->set($multivol_exist); - } - if ($multivol_exist) { - $ewrapper->field_multivol->set($multivol_exist); + + $ewrapper->field_multivol->set($multivol_exist); } $ewrapper->save(); From 367a3f002b226ce5d7c6d8b1c03d29b3eb9c30c9 Mon Sep 17 00:00:00 2001 From: Ekaterina Pechekhonova Date: Sun, 29 Mar 2020 23:17:39 -0400 Subject: [PATCH 08/10] pdf labels and check for multivol value --- dlts_viewer.module | 4 ++-- drush/inc/create.dlts_book.inc | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlts_viewer.module b/dlts_viewer.module index 3f3e49d4..d44ddc25 100755 --- a/dlts_viewer.module +++ b/dlts_viewer.module @@ -285,8 +285,8 @@ function dlts_viewer_flush_caches() { t('Low-resolution'); t('Vol.'); t('Download'); - t('High resolution PDF'); - t('Low resolution PDF '); + t('High-resolution PDF'); + t('Low-resolution PDF '); } // here we need to make sure we delete the record from Apache Solr diff --git a/drush/inc/create.dlts_book.inc b/drush/inc/create.dlts_book.inc index 894e3217..9f27182f 100755 --- a/drush/inc/create.dlts_book.inc +++ b/drush/inc/create.dlts_book.inc @@ -632,10 +632,10 @@ function create_dlts_book_from_json($books, $cretePages = FALSE, $legacy = FALSE // do we have a valid extension if (!in_array($ext,$valid_extensions)) continue; if (strpos($pdf_file, '_hi')) { - $pdf_files[] = array('file' => $pdf_file, 'label' => 'High resolution'); + $pdf_files[] = array('file' => $pdf_file, 'label' => 'High-resolution'); } elseif (strpos($pdf_file, '_lo')) { - $pdf_files[] = array('file' => $pdf_file, 'label' => 'Low resolution'); + $pdf_files[] = array('file' => $pdf_file, 'label' => 'Low-resolution'); } else { $pdf_files[] = array('file' => $pdf_file); @@ -648,10 +648,10 @@ function create_dlts_book_from_json($books, $cretePages = FALSE, $legacy = FALSE // check that the URI is not bigger than the allowed MySQL size for varchar with index if (strlen($pdf_uri) > 255) continue; if (strpos($pdf_uri, '_hi')) { - $pdf_files[] = array('file' => $pdf_uri, 'label' => 'High resolution'); + $pdf_files[] = array('file' => $pdf_uri, 'label' => 'High-resolution'); } elseif (strpos($pdf_uri, '_lo')) { - $pdf_files[] = array('file' => $pdf_uri, 'label' => 'Low resolution'); + $pdf_files[] = array('file' => $pdf_uri, 'label' => 'Low-resolution'); } else { $pdf_files[] = array('file' => $pdf_uri); From 4f27067b01b0b22c17402e75d48bdc88b822ac0f Mon Sep 17 00:00:00 2001 From: Alberto Ortiz Flores Date: Mon, 30 Mar 2020 15:30:19 -0400 Subject: [PATCH 09/10] DLTSVIEWER-92 --- js/ui.photo.components.yui.js | 79 ++++++++++++----------------------- 1 file changed, 26 insertions(+), 53 deletions(-) diff --git a/js/ui.photo.components.yui.js b/js/ui.photo.components.yui.js index 833bd946..1a840792 100644 --- a/js/ui.photo.components.yui.js +++ b/js/ui.photo.components.yui.js @@ -15,19 +15,9 @@ YUI().use( Y.io.header('X-PJAX', 'true'); var PJAX_INVALID = -1; var PJAX_UNKNOWN_ERROR = -2; - var html = Y.one('html'); - var top = Y.one('#top'); - var pagemeta = Y.one('.pane.pagemeta'); - var display = Y.one('#display'); - var displayData = display.getData(); - var photoUrl = displayData['url']; - var sequenceCount = parseInt(displayData['sequence-count'] , 10); - var sequence = parseInt(displayData['sequence'] , 10); - var pager=Y.one('#pager'); + var html = Y.one('html'); /** nodes */ - - function on_button_click(e) { e.preventDefault(); var self = this; @@ -74,13 +64,10 @@ YUI().use( Y.fire(event_prefix + ':toggle', e); } - function pjax_navigate(e) { - Y.one('body').addClass('openlayers-loading') - var msg = e.url.replace(photoUrl, '' ).replace('/' , ''); - if (/(^[\d]+$){1}/.test(msg ) || /(^[\d]+-[\d]+$){1}/.test(msg)) { - this.one('.current_page').set('text', msg); - } + Y.one('body').addClass('openlayers-loading'); + var parts = e.url.split('/'); + this.one('.current_page').set('text', parts[parts.length - 1]); this.addClass('loading').show(); } @@ -168,7 +155,6 @@ YUI().use( function fullscreenOn(e) { var docElm = document.documentElement; - var metadata = Y.one('.pagemeta'); var top = Y.one('.top'); var button = Y.one('#button-metadata'); if (button) { @@ -216,7 +202,6 @@ YUI().use( Y.CrossFrame.postMessage("parent", JSON.stringify({fire: 'button:button-fullscreen:off'})); } - function change_page(config) { var map; var service; @@ -240,7 +225,6 @@ YUI().use( }, '#' + config.id); } - function openLayersTilesLoading() { if (Y.one('body').hasClass('openlayers-loading')) { Y.later(200, Y.one('.pane.load'), openLayersTilesLoading); @@ -250,27 +234,14 @@ YUI().use( } } - - function onButtonThumbnailsOnIOStart(e) { - var thumbnails = Y.one('#thumbnails'); - if (thumbnails) { - thumbnails.removeClass('hidden'); - } - } - function onButtonThumbnailsOn(e) { - - e.halt(); - var node = Y.one('.node.pjax'); - var dataSequence = Math.round(parseInt(sequence), 10) /20; - var container = Y.one('.pjax-container'); - location.href = e.currentTarget.get('href') + '?page=' +0 ; + e.halt(); + window.location.href = e.currentTarget.get('href') + '?page=' + 0; } - function onThumbnailsContainerPagerClick(e) { - e.preventDefault(); - pjax.navigate(e.currentTarget.get('href')); + e.preventDefault(); + pjax.navigate(e.currentTarget.get('href')); } function onThumbnailsPagePagerClick(e) { @@ -318,23 +289,22 @@ YUI().use( Y.one('.thumbnails-container').removeClass('io-loading'); } - function onThumbnailsPageSuccess(id, response) { - Y.one('.thumbnails-container').set('innerHTML', response.response); + function onThumbnailsPageSuccess(_id, response) { + Y.one('.thumbnails-container').set('innerHTML', response.response); } - function onThumbnailsPageFailure(id, request) { - Y.log('failure'); + function onThumbnailsPageFailure() { + Y.log('failure'); } - function onThumbnailsOnSuccess(id, request) { - var node = Y.one('#thumbnails'); - if (node) { - node.set('innerHTML', request.response); - node.addClass('active'); - } + function onThumbnailsOnSuccess(_id, request) { + var node = Y.one('#thumbnails'); + if (node) { + node.set('innerHTML', request.response); + node.addClass('active'); + } } - /** events listeners */ /** @@ -362,8 +332,6 @@ YUI().use( /** Thumbnails related events */ Y.on('button:button-thumbnails:on', onButtonThumbnailsOn); - //Y.on('button:button-thumbnails:off', onButtonThumbnailsOff); - Y.delegate('click', onThumbnailsContainerPagerClick, 'body', '.thumbnails .views-row a'); Y.one('body').delegate('click', onThumbnailsPagePagerClick, '#thumbnails .pager a'); @@ -375,12 +343,17 @@ YUI().use( var currentTarget = e.currentTarget; var value = currentTarget.one(':checked').get('value'); var url = value.substring(value.indexOf('::') + 2, value.length); - var data = { url : url }; + var data = { + url : url + }; if (window.self === window.top) { - window.location.replace(url); + window.location.replace(url); } else { - Y.CrossFrame.postMessage('parent', JSON.stringify({ fire: 'change:option:multivolume', data: $data })); + Y.CrossFrame.postMessage('parent', JSON.stringify({ + fire: 'change:option:multivolume', + data: data + })); } } From 9761b2196daf23be9bae22f1da7e05640f8e3347 Mon Sep 17 00:00:00 2001 From: katepechekhonova Date: Mon, 6 Apr 2020 01:22:01 -0400 Subject: [PATCH 10/10] Added check for array for series book --- drush/inc/create.dlts_series_book.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drush/inc/create.dlts_series_book.inc b/drush/inc/create.dlts_series_book.inc index d0d32f98..05b88b1f 100755 --- a/drush/inc/create.dlts_series_book.inc +++ b/drush/inc/create.dlts_series_book.inc @@ -95,7 +95,14 @@ function create_dlts_series_book($node) { $ewrapper->field_book->set($book_exist); } } - $series_exist = series_nid($node->isPartOf->identifier); + + if (is_array($node->isPartOf)) { + $series_exist = series_nid($node->isPartOf[0]->identifier); + } + else { + $series_exist = series_nid($node->isPartOf->identifier); + } + if ($series_exist) { $ewrapper->field_series->set($series_exist);