Commit e9843f49 authored by webchick's avatar webchick

Issue #2080391 by johnmcc, Bladedu, chertzog, jeroen12345: Remove Unused local...

Issue #2080391 by johnmcc, Bladedu, chertzog, jeroen12345: Remove Unused local variables from multiple core files.
parent b5a97524
......@@ -327,7 +327,6 @@ private function parseArithmetic($string) {
for ($i = 2; $i < count($element_stack); $i++) {
$op = $element_stack[$i];
if (!empty($precedence[$op])) {
$f = "";
if ($op == ":") {
$f = $element_stack[$i - 2] . "):" . $element_stack[$i - 1] . ")";
}
......
......@@ -33,12 +33,6 @@ function content_translation_overview(EntityInterface $entity) {
$rows = array();
if (language_multilingual()) {
// If we have a view path defined for the current entity get the switch
// links based on it.
if ($path) {
$links = _content_translation_get_switch_links($path);
}
// Determine whether the current entity is translatable.
$translatable = FALSE;
foreach (field_info_instances($entity->entityType(), $entity->bundle()) as $instance) {
......@@ -74,7 +68,6 @@ function content_translation_overview(EntityInterface $entity) {
// Existing translation in the translation set: display status.
$source = isset($entity->translation[$langcode]['source']) ? $entity->translation[$langcode]['source'] : '';
$is_original = $langcode == $original;
$translation = $translations[$langcode];
$label = $entity->label($langcode);
$link = isset($links->links[$langcode]['href']) ? $links->links[$langcode] : array('href' => $path, 'language' => $language);
$row_title = l($label, $link['href'], $link);
......@@ -202,7 +195,6 @@ function content_translation_add_page(EntityInterface $entity, Language $source
$form_state['langcode'] = $target->id;
$form_state['content_translation']['source'] = $source;
$form_state['content_translation']['target'] = $target;
$controller = content_translation_controller($entity->entityType());
$form_state['content_translation']['translation_form'] = !$entity->access('update');
return \Drupal::entityManager()->getForm($entity, $operation, $form_state);
}
......@@ -253,7 +245,6 @@ function content_translation_prepare_translation(EntityInterface $entity, Langua
* @deprecated Use \Drupal\content_translation\Form\ContentTranslationForm::deleteTranslation()
*/
function content_translation_delete_confirm(array $form, array $form_state, EntityInterface $entity, Language $language) {
$langcode = $language->id;
$controller = content_translation_controller($entity->entityType());
return confirm_form(
......
......@@ -216,12 +216,9 @@ function image_file_download($uri) {
// Private file access for image style derivatives.
if (strpos($path, 'styles/') === 0) {
$args = explode('/', $path);
// Discard the first part of the path (styles).
array_shift($args);
// Get the style name from the second part.
$style_name = array_shift($args);
// Remove the scheme from the path.
array_shift($args);
// Discard "styles", style name, and scheme from the path
$args = array_slice($args, 3);
// Then the remaining parts are the path to the image.
$original_uri = file_uri_scheme($uri) . '://' . implode('/', $args);
......
......@@ -295,7 +295,7 @@ function options_extract_allowed_values($string, $field_type, $generate_keys) {
$generated_keys = $explicit_keys = FALSE;
foreach ($list as $position => $text) {
$value = $key = FALSE;
$key = FALSE;
// Check for an explicit key.
$matches = array();
......
......@@ -460,7 +460,6 @@ function overlay_get_mode() {
* @see \Drupal\overlay\EventSubscriber\OverlaySubscriber::onRequest()
*/
function overlay_set_mode($mode = NULL) {
global $base_path;
// We're not using drupal_static() here since the static cache is reset in
// drupal_flush_all_caches(); this could lead to the loss of the overlay when
// submitting the admin/modules form, for instance.
......
......@@ -69,7 +69,6 @@ protected function assertRevisions($entity_type) {
$entity->field_test_text->value = 'bar';
$entity->save();
$entities = array();
$names = array();
$texts = array();
$revision_ids = array();
......
......@@ -238,7 +238,7 @@ function testRequiredCheckboxesRadio() {
*/
function testRequiredTextfieldNoTitle() {
$form = $form_state = array();
$form = form_test_validate_required_form_no_title($form, $form_state);
form_test_validate_required_form_no_title($form, $form_state);
// Attempt to submit the form with no required field set.
$edit = array();
......@@ -528,7 +528,7 @@ function testDisabledElements() {
// Ensure that the returned values match the form's default values in both
// cases.
foreach ($returned_values as $type => $values) {
foreach ($returned_values as $values) {
$this->assertFormValuesDefault($values, $form);
}
}
......
......@@ -15,7 +15,7 @@ function database_test_query_alter(AlterableInterface $query) {
if ($query->hasTag('database_test_alter_add_join')) {
$people_alias = $query->join('test', 'people', "test_task.pid = %alias.id");
$name_field = $query->addField($people_alias, 'name', 'name');
$query->addField($people_alias, 'name', 'name');
$query->condition($people_alias . '.id', 2);
}
......
......@@ -165,7 +165,6 @@ public function form(array $form, array &$form_state) {
'#type' => 'container',
'#id' => 'edit-display-settings',
);
$display_title = $this->getDisplayLabel($view, $display_id, FALSE);
// Add a text that the display is disabled.
if ($view->getExecutable()->displayHandlers->has($display_id)) {
......@@ -330,7 +329,6 @@ public function getDisplayTab($view) {
// If the plugin doesn't exist, display an error message instead of an edit
// page.
if (empty($display)) {
$title = isset($display->display['display_title']) ? $display->display['display_title'] : $this->t('Invalid');
// @TODO: Improved UX for the case where a plugin is missing.
$build['#markup'] = $this->t("Error: Display @display refers to a plugin named '@plugin', but that plugin is not available.", array('@display' => $display->display['id'], '@plugin' => $display->display['display_plugin']));
}
......@@ -899,7 +897,6 @@ public function getFormBucket(ViewUI $view, $type, $display) {
$build['#name'] = $build['#title'] = $types[$type]['title'];
$rearrange_url = "admin/structure/views/nojs/rearrange/{$view->id()}/{$display['id']}/$type";
$rearrange_text = $this->t('Rearrange');
$class = 'icon compact rearrange';
// Different types now have different rearrange forms, so we use this switch
......@@ -909,7 +906,6 @@ public function getFormBucket(ViewUI $view, $type, $display) {
// The rearrange form for filters contains the and/or UI, so override
// the used path.
$rearrange_url = "admin/structure/views/nojs/rearrange-filter/{$view->id()}/{$display['id']}";
$rearrange_text = $this->t('And/Or, Rearrange');
// TODO: Add another class to have another symbol for filter rearrange.
$class = 'icon compact rearrange';
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment