Problem/Motivation
A Drupal site builder or someone new to Drupal needs instructions written in language they can understand. The modal window with Composer install instructions seems too technical and should be evaluated for ease of understanding and ability to follow the steps listed.
Steps to reproduce
Install the protoype version of the contributed project_browser module using gitpod or simplytest.me. A link for each of these op[tions can be found at https://www.drupal.org/project/project_browser
Log into the site using the default credentials. Select "Extend" from the Admin menu, then select the new "Browse" tab under the page title "Browse Drupal.org projects"
Select the "Download button" from any of the modules displayed in the card view
The text in the modal window is what we would like to have evalauated for ease of understanding by a Drupal site builder or someone new to Drupal trying to figure out how to install a module they have just found using the Project Browser tool.


| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Browse Drupal.org projects Drupal 2022-07-01 13-25-50.png | 100.26 KB | tim.plunkett |
| Screen Shot 2021-11-02 at 6.30.04 PM.png | 205.91 KB | leslieg |
Issue fork project_browser-3247332
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
Comment #2
leslieg commentedComment #3
leslieg commentedComment #4
volkswagenchickThanks leslie, I will look at these and also ask some fellow sitebuilders.
Comment #5
chrisfromredfinFYI we may have download via composer functionality from the UI much sooner than we expected: https://www.drupal.org/project/project_browser/issues/3245770
Comment #6
ultimikeI attempted to test this using Gitpod (via the button on the Project Browser project page) and during the automatic setup, I received the message:
I was able to get around this by first running
ddev composer require drupal/package_managerThen
ddev drush en -y project_browserIn case any other potential testers are wondering, the "default credentials" are:
Also in the instructions above, it should be "Browse modules", not just "Browse".
Regarding the text in the modal window...
I reviewed the text with a few of our current Drupal Career Online students - their comments will be added below by each student :)
I would like to suggest the following change from this:
To this:
Also from:
To this:
-mike
Comment #7
volkswagenchickI suggest the first sentence reads...
I want folks to be mindful of using reductive language.
Comment #8
pearcraft commentedI've found an issue with the text in the "Download button" modal window:
It is in the "1. Download" section in the 5th paragraph that starts with the text "Didn't work?"
The rest of the paragraph, "Learn how to troubleshoot Composer." is blue (like a link) but isn't underlined because it isn't a link.
I'm guessing the blue decorated text should lead here:
https://www.drupal.org/docs/develop/using-composer/troubleshooting-composer
The complete 5th paragraph should then be formed like this:
Didn't work? Learn how to troubleshoot Composer.
Comment #9
chrisfromredfinLink fixed in https://www.drupal.org/project/project_browser/issues/3243028
Comment #10
chrisfromredfinWe were thinking more about this (Leslie and I), that there's possibly three states in the UI for the button:
1. Download (you do not have this module on this site yet)
2. Install (you have it downloaded, but not installed/enabled)
3. Installed (already download and enabled)
For each condition, should we have different modal popups? Should the first give you composer instructions, the second give you "how to enable a module" instructions, and the third "how to remove a module" instructions? We may want to spin up child issues for this.
Comment #11
leslieg commentedWe don't want to copy the copy already on Drupal.org so it may be best to just add links to that documentation
Comment #12
chrisfromredfinComment #13
chrisfromredfinComment #14
tim.plunkettThis issue isn't actionable at the moment. Let's also consider postponing this on #3284945: Install endpoints that leverage Package Manager + core APIs (which would mean changing the tag from MVP to 2.0)
Comment #15
tim.plunkettCan someone help with this? Here's a current screenshot of this text:
Comment #16
phenaproximaThat should be "the recommended way". Also, this sentence should end with a period.
I would say "terminal" or "command line" instead of "CLI", which reads like developer jargon to me.
The example command uses
drupal/foo. If it's not too hard to insert the actual name of the package they're trying to install, I think that would be more useful, since it gives people a command they can just copy and paste. (Don't make me think!)Otherwise, seems reasonable enough.
Comment #17
phenaproximaOh, one more thing: the Drush command in the screenshot is
drush pm-enable foo. Two things:foo?drush thenis the alias; the full command escapes me at the moment) to use, so that people can copy and paste.Comment #18
phenaproximaOh, and a nitpick: in the explanatory text, "drush" should be "Drush", since it is a proper noun.
Comment #19
xjmAlso, remove the word "simply" since this is a bit ableist/can be implicitly insulting if someone finds using the command line challenging.
Comment #20
xjmAnd there is a missing period at the end of the first sentence. :)
Comment #21
bnjmnm--with-all-dependenciesis specific to Composer 2.x. Until I started working with Automatic Updates, I've been using Composer 1.x just fine with Drupal and it's possible that's true for other users. Unless Composer 2 is explicitly enforced, and I somehow circumvented the requirement, there should either be version-specific instructions, or a single version that will work on both 1 and 2.Comment #22
phenaproximaRegarding #21: I switched back to Composer 1, and according to
composer help require, there is an--update-with-all-dependenciesflag. Composer 2 agrees. So maybe that should be used here?Comment #23
tim.plunkettAll good suggestions! A couple clarifications:
Comment #24
ressaIs
--with-all-dependenciesor variants even needed? It is not included under the modules, where this is the recommended method:Install: $ composer require 'drupal/matomo:^1.19'From https://www.drupal.org/project/matomo
Comment #25
tim.plunkettI'll work on this
Comment #26
tim.plunkettWasn't able to make time for this and don't want to hold anyone up
Comment #28
bnjmnmComment #29
tim.plunkettI think this improvement is good enough to ship, it needs a rebase and then I think we're good to go.
Comment #31
mmjvb commentedAgree with removal of --with-all-dependencies as this is the `composer require` command, not `composer update` command. The option for `composer require` is --update-with-all-dependencies (-W).
The shortcuts -w|-W are the same for require and update.
Recommend against using them as they extend the scope of packages in an unknown way. Suggest using require --no-update commands when multiple modules/packages are involved followed by an update whitelisting them.
The problems reported when failing to do as requested should not be regarded as an issue. It shows the requirements for this site are more complex and need feedback from the user how to deal with them. It is unlikely that using the option provides the desired result. The command might not produce the report anymore, but that doesn't mean it produces the desired result. The user should get used to having to deal with these kind of situations, it is not exceptional !
Again, there is no algorithm to make sure the command succeeds. User decisions are needed due to circumstances. Consider taking these decisions without consulting them very bad practice.
Comment #32
fjgarlin commentedChecked the code and tested it and it all looks good. Marking as RTBC.
Also filed this follow-up issue #3296250: machine_name field might not match the composer require namespace.
Comment #34
tim.plunkettGreat! Glad to see this cleaned up.