Disable "Update" option on Extend menu

Created on 2 April 2024, 8 months ago
Updated 14 June 2024, 5 months ago

Problem/Motivation

We removed the "Add new module" page if you select the option in project browser settings, but left behind the "Update" page from the extend menu.

Since this doesn't use composer, it should be removed too.

Steps to reproduce

Browse to Extend menu and select the "Update" option.

Proposed resolution

If "Disable add new module" is selected in Project Browser settings, the "Update" menu option should be hidden.

Access to the update page should also be disabled.

The text of the option in Project Browser settings should also be updated to something like "Disable Add new module and Update pages".

โœจ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @lostcarpark
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    I'm not sure about this. Don't we need the update page to see what has security updates? Do we only need a warning that "using this page will not use Composer the same way Project Browser does" instead?

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    We want the "Available updates" page (/admin/reports/updates).

    However, the "Extend->Update" page (/admin/modules/update) allows module updates to be installed in a non-Composer way, so I think it should be hidden.

    Need to check how the Automatic Updates module handles module updates, and whether it replaces or modifies this page.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shubham Garg

    Shubham Garg โ†’ made their first commit to this issueโ€™s fork.

  • First commit to issue fork.
  • Merge request !460Update project_browser.module โ†’ (Open) created by Shubham_Kumar
  • First commit to issue fork.
  • Pipeline finished with Success
    6 months ago
    Total: 379s
    #166026
  • Status changed to Needs review 6 months ago
  • Pipeline finished with Failed
    6 months ago
    Total: 377s
    #166029
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Good work, @Shubham_kumar and @mahtab_alam. You seem to have both submitted very similar changes.

    However, the "Update" should only be disabled if the "Disable add new module" config setting is selected.

    I note that you've used a different hook to the way "Add new module". I may have just not found that hook. I don't mind which hook we use, but I feel we should be consistent.

    I also think we should disable the route, not just the menu option, so that people can't get sent to the page another way. I implemented an event subscriber to do that for the Add New Module page.

    One problem I had was getting the disabled menu option to stop showing up in Admin Toolbar, so please make sure your change works there.

    Finally, I added the "DisableAddNewModuleTest" functional tests. It would be nice to see the "Update" option tested there.

    Have a look at the previous change โœจ Add "Disable Add new module page" option to settings page Fixed .

    Thanks for working on this!

  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark
  • Merge request !508Disable update module page with tests. โ†’ (Open) created by lostcarpark
  • Pipeline finished with Failed
    5 months ago
    Total: 434s
    #197647
  • Pipeline finished with Success
    5 months ago
    Total: 403s
    #197654
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    lostcarpark โ†’ changed the visibility of the branch 3437724-disable-update-option to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    lostcarpark โ†’ changed the visibility of the branch 3437724-unset-variable to hidden.

  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    MR !508 ready for review.

    I have extended the previously added functionality to disable the "Update" page, which allows modules to be updated using tar files.

    I have also extended the tests to cover.

  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    Don't do this! That route is taken over by Automatic Updates, so if you do this as-is, you'll break compatibility with that. At the very least, make sure it doesn't disable the route if Automatic Updates, or Automatic Updates Extensions, is installed.

    Also, why do we bother hiding this functionality behind a config flag? IMHO we should just always disable the "add module" route anyway, since it doesn't work (modules with Composer dependencies, which is probably most of them at this point, won't function properly if they're added as ZIP files), and remove the config flag.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Okay, I see this now. I had seen that the "Automatic Updates Extensions" adds a "Update Extensions" tab, but I missed Automatic Updates changed the handling of the route.

    I will look at adding a check for the Automatic Updates modules are installed.

  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland lostcarpark

    Also, I see your point about removing the config flag. I suggest opening a separate issue to look at that.

Production build 0.71.5 2024