Problem/Motivation

Since the name of the button on the Extend page is "Install", and also pm:install the default Drush command to install a module, whereas pm-enable is merely an alias, we should probably use that. This way, we can also reduce "install/enable" to just "install", and match the heading.

$ drush | grep "pm:install"
  pm:install (in, install, en, pm-enable, pm:enable) Enable one or more modules.

Steps to reproduce

Install https://www.drupal.org/project/project_browser. Log in to 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".

Click the "Download button" from any of the modules displayed in the card view.

Find the Drush part at the bottom, under "Install".

Proposed resolution

Update the Drush section in the Download modal window.

Now

To use the module you must next install/enable it. Visit the modules page to install the module using your web browser.

Alternatively, you can use Drush to enable it via the command line.:

drush pm-enable ctools

Better?

To use the module you must next install it. Visit the modules page to install the module using your web browser.

Alternatively, you can use Drush to install it via the command line:

drush pm:install ctools

User interface changes

2022-08-02/3296264 after.png

Remaining tasks

  • ✅ File an issue about this project
  • ☐ Manual Testing
  • ☐ Code Review
  • ☐ Accessibility Review
  • ☐ Automated tests needed/written?
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

ressa created an issue. See original summary.

ressa’s picture

Assigned: Unassigned » ressa

Trying to include all the changed files after compiling, sorry about the noise.

ressa’s picture

Assigned: ressa » Unassigned

Closing my Merge Request, since my compiled svelte-files didn't match the test ...

ressa’s picture

Status: Active » Needs review
StatusFileSize
new513.8 KB

Trying a patch file in stead.

ressa’s picture

Status: Needs review » Needs work

... which also fails. I can't figure out how to run commit-code-check.sh against contrib module, which I think would shed some light on the reason. I found https://www.drupal.org/docs/develop/development-tools/running-core-devel..., but it seems to be focused on core, and not a module.

Anyway, it looks like the problem is that "Svelte compiled files do not match." so if anyone else can make them match, feel free to create a patch :-)

tim.plunkett’s picture

The README in the module has the necessary information: https://git.drupalcode.org/project/project_browser/-/blob/1.0.x/README.m...

Though I think you must run yarn build from inside the sveltejs directory, not yarn dev (that's for real-time dev, as opposed to the build for committing the changes)

tim.plunkett’s picture

The test error says: "Svelte compiled files do not match. Running yarn build and commiting the changs should fix this."
I like the double typo (committing and changes) but yeah, that :)

ressa’s picture

Thanks for pointing me to the README file, I hadn't seen the info there. But I get the same result ...

By the way, I am using Ubuntu 20.04.3 and yarn 1.22.19 (I tried 1.22.17 also, but it made no difference).

It would be great if I could run commit-code-check.sh locally, before uploading the patch to drupal.org. Do you know if it's documented somewhere how to run it against a module? Or maybe simpler, how can I run the command, which finds that Svelte compiled files do not match, to perhaps get some more details?

Perhaps you can try to make the three changes in sveltejs/src/Project/ActionButton.svelte, compile the files, and see if you get a better result?

-      'To use the module you must next install/enable it. Visit the !module_page_open modules page !close to install the module using your web browser!close',
+      'To use the module you must next install it. Visit the !module_page_open modules page !close to install the module using your web browser!close',

-      'Alternatively, you can use !drush_openDrush!close to enable it via the command line.',
+      'Alternatively, you can use !drush_openDrush!close to install it via the command line',

-                <input id="${project.field_project_machine_name}-install-command" value="drush pm-enable ${project.field_project_machine_name}"/>
+                <input id="${project.field_project_machine_name}-install-command" value="drush pm:install ${project.field_project_machine_name}"/>

... and yes, I also appreciated commiting and changs :-)

ressa’s picture

ressa’s picture

omkar-pd made their first commit to this issue’s fork.

omkar-pd’s picture

Added build files.

narendrar’s picture

Merge latest 1.0.x branch code in MR, resolve conflicts, run yarn build to solve this issue.

omkar-pd’s picture

MR 201 is up to date with 1.0.x but the tests are running against old MR 199 which is closed. I tried to reopen that MR but it gives me a 404 error.

ressa’s picture

Is it because you need to change Status to "Needs review", to trigger the test?

Or maybe just "Create new branch" and start fresh?

narendrar’s picture

Status: Needs work » Needs review

I don't think we need to mark it as "Needs review" to trigger the test in case of MR. Not sure but somehow the MR was not working properly.
I created another MR from @omkar-pd's branch and it seems working now.

ressa’s picture

Ah yes, marking it as "Needs review" is probably only required for the old patch method, where you attach a file, as in #6. Great that you got it created together with @omkar-pd, and that the test passes.

tim.plunkett’s picture

Rebased and then pushed up one commit for the remaining references to "enable"

aarti zikre’s picture

reviewing this

aarti zikre’s picture

Assigned: Unassigned » aarti zikre
aarti zikre’s picture

Issue summary: View changes
StatusFileSize
new57.7 KB

Summary Updated!

aarti zikre’s picture

Assigned: aarti zikre » Unassigned
ressa’s picture

This issue is about changing from using "enable" to "install" as can be read in the summary. Also, please see as an example from the plain diff one of the changes:

- <input id="${project.field_project_machine_name}-install-command" value="drush pm-enable ${project.field_project_machine_name}"/>
+ <input id="${project.field_project_machine_name}-install-command" value="drush pm:install ${project.field_project_machine_name}"/>

From https://git.drupalcode.org/project/project_browser/-/merge_requests/202....

Maybe you can give it another go, check with 202.diff exactly what changes should happen after patching, and check if it works?

aarti zikre’s picture

Issue summary: View changes
StatusFileSize
new60.85 KB
aarti zikre’s picture

StatusFileSize
new107.31 KB
new26.01 KB

Apologize for the confusion
Reviewed and verified MR
https://git.drupalcode.org/issue/project_browser-3296264/-/tree/3296264-....

Testing step:

* Install new instance of Drupal 9.5.x.
* Install and enable project browser module.
* Go to the /admin/modules/browse.
* Click on Download button.

Test Result:
The popup modal have the install as well as download drush command and another way to enable module. In the description it is shown that

"To use the module you must next install/enable it. Visit the modules page to install the module using your web browser.

Alternatively, you can use Drush to enable it via the command line.:"

drush pm:install ctools

where
modules page has link to : /admin/modules#module-machine-name
drush linked to the : https://www.drush.org/latest/
In drush command module name change as per our selection

Every things looks great. Excluding copy command feature. It is not copy the command.

Small suggestion:

can we add space between . and :

here in the description
Alternatively, you can use Drush to enable it via the command line.:"

Attaching SS for reference.

Detail page on browser:
2022-08-02/3296264 after.png

Enable module using drush install command:
2022-08-02/3296264 after_1.png

CMS back end after installation of particular module:

2022-08-02/3296264 after_2.png

Moving to need works

aarti zikre’s picture

Status: Needs review » Needs work
ressa’s picture

Thanks @aarti zikre, that looks better. (though your text still says "Alternatively, you can use Drush to enable ..." ?)

Good catch with the punctuation mark. Actually, we just need to get rid of it like this:

-      'Alternatively, you can use !drush_openDrush!close to enable it via the command line.',
+      'Alternatively, you can use !drush_openDrush!close to install it via the command line',

Since it might involve generating new files after updating the ActionButton.svelte file, and I failed miserably with mysteriously failing tests last time I tried, perhaps someone else can do that?

narendrar’s picture

Status: Needs work » Needs review
omkar-pd’s picture

Status: Needs review » Reviewed & tested by the community

LGTM.

tim.plunkett’s picture

Thanks! Merged

omkar-pd’s picture

Status: Reviewed & tested by the community » Fixed
ressa’s picture

Thanks everybody, it looks good!

Status: Fixed » Closed (fixed)

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