Problem/Motivation

As far as I can see the Update module is not dependent on the File module anymore. The file form element is provided by core.

Proposed resolution

  • Remove the dependency from update.info.yml
  • Stop installing the File module in \Drupal\Core\Installer\Form\SiteConfigureForm::submitForm

Remaining tasks

User interface changes

None

API changes

No more dependency on the File module. Not really an API change but worth a change record.

Data model changes

None

Issue fork drupal-3014051

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

govind.maloo’s picture

StatusFileSize
new1.19 KB
govind.maloo’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3014051-2.patch, failed testing. View results

joachim’s picture

> 1) Drupal\Tests\update\Functional\UpdateUploadTest::testUploadModule
Exception: Error: Call to undefined function Drupal\update\Form\file_save_upload()

It looks like file module is still needed.

alexpott’s picture

Ah I missed that. So I guess now the question becomes why are we not doing something similar to \Drupal\system\Form\ThemeSettingsForm which detects if the file module is installed. I think the update module offers functionality that's important - ie checking whether your site is up-to-date that is important without the file module.

Raman Starshykh’s picture

Assigned: Unassigned » Raman Starshykh
Raman Starshykh’s picture

Assigned: Raman Starshykh » Unassigned
mitrpaka’s picture

Status: Needs work » Needs review
StatusFileSize
new4.71 KB
new3.24 KB

Attached patch provides upload option only if file module exists.

volkswagenchick’s picture

Issue tags: +fldc19, +sfdug, +dcnj19

Tagging for upcoming contribution days.

volkswagenchick’s picture

Issue tags: +midcamp2019

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tedbow’s picture

This might be an edge case but I will bring up just so it is not forgotten

Standard profile already depends on File module so it shouldn't make a difference for it but for another install profile that depended on Update module but didn't depend on or File directly or a module that depends directly this would change functionality. Because they would not be able to update load archive(though this not recommended anyways)

But most install profiles would at least have Image module enabled which also depends on File.

So it would only affect insall profiles that dependedon Update and

  1. didn't depend on image, local, or editor
  2. Actually had user uploading archives via the Update module(not composer based?)

I would guess that would be zero install profiles but just thought I would point it out.

We should at least point this out in the change record for this issue

quietone’s picture

Status: Needs review » Needs work

Setting to NW for the points in #17 as well as a reroll.

suresh prabhu parkala’s picture

StatusFileSize
new4.75 KB

Just a re-roll against 9.3.x.

tedbow’s picture

Status: Needs work » Needs review

Setting to "Needs Review" to trigger tests

Status: Needs review » Needs work

The last submitted patch, 19: 3014051-19.patch, failed testing. View results

tedbow’s picture

Status: Needs work » Needs review

Updated to a Merge Request and fixed test failures in #19

tim.plunkett’s picture

Status: Needs review » Needs work
Issue tags: -fldc19, -sfdug, -dcnj19, -midcamp2019
tedbow’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

CR written, and the patch is now good to go. Thanks @tedbow!

alexpott’s picture

+++ b/core/modules/update/src/Form/UpdateManagerInstall.php
@@ -111,17 +111,20 @@ public function buildForm(array $form, FormStateInterface $form_state) {
-    $form['information'] = [
-      '#prefix' => '<strong>',
-      '#markup' => $this->t('Or'),
-      '#suffix' => '</strong>',
-    ];
-
-    $form['project_upload'] = [
-      '#type' => 'file',
-      '#title' => $this->t('Upload a module or theme archive'),
-      '#description' => $this->t('For example: %filename from your local computer', ['%filename' => 'name.tar.gz']),
-    ];
+    // Provide upload option only if file module exists.
+    if ($this->moduleHandler->moduleExists('file')) {
+      $form['information'] = [
+        '#prefix' => '<strong>',
+        '#markup' => $this->t('Or'),
+        '#suffix' => '</strong>',
+      ];
+
+      $form['project_upload'] = [
+        '#type' => 'file',
+        '#title' => $this->t('Upload a module or theme archive to install'),
+        '#description' => $this->t('For example: %filename from your local computer', ['%filename' => 'name.tar.gz']),
+      ];
+    }

I was wondering if the change in the form array would affect contrib - looking at http://grep.xnddx.ru/search?text=%27project_upload%27&filename= I don't think so. The unsets will continue to work just fine.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 052816d and pushed to 9.3.x. Thanks!

  • alexpott committed 052816d on 9.3.x
    Issue #3014051 by tedbow, mitrpaka, govind.maloo, Suresh Prabhu Parkala...
tedbow’s picture

Thanks @alexpott and everyone!

Status: Fixed » Closed (fixed)

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