Improve usability:
see patch

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

Status: Active » Needs review
StatusFileSize
new780 bytes

see patch

andypost’s picture

Not sure that's right place to throw exception, and log it... because exception will be logged anyway

Meantime better to add hook_requirements to do this check

+++ b/src/Plugin/DMU/Indexer/Functions.php
@@ -49,6 +49,11 @@ class Functions extends IndexerBase implements IndexerExecutionInterface, Indexe
+    if (!class_exists('Pharborist\Parser')) {

I bet it will not work because class_exists will not call autoloader

gábor hojtsy’s picture

Status: Needs review » Fixed

If I understand this right, this will happen to someone who (a) does not install their Drupal 8 site with composer (b) did not install their drupalmoduleupgrader with composer either, but (d) drush dl-ed the module or had a git checkout of it.

I think its a fine improvement for that case.

  • Gábor Hojtsy committed 2bebfff on 8.x-1.x
    Revert "Issue #3082040 by joseph.olstad: improve usability of...
gábor hojtsy’s picture

Status: Fixed » Needs work

Huh, I pulled the trigger too fast. Let's discuss.

joseph.olstad’s picture

yes I double tested it before and after running composer up

to test this, delete your vendor folder in the drupalmoduleupgrader module

so ya, I downloaded Drupal 8.8.x (dev) core, installed it normally without composer

then I downloaded drupalmoduleupgrader
put it in the modules folder
this helpful message will come up if the composer up has not been run

so now if someone installs without composer and they run this they will get a helpful suggestion.

joseph.olstad’s picture

composer 1.6.3 is what I'm running and Drupal 8.8.x core does not allow me to do a composer up from the drupal core folder
however I can do a composer up from the drupalmoduleupgrader

Drupal 8.7.x did not have this problem with composer version 1.6.3 (default version provided with Ubuntu 18.04 LTS)

It's pretty agressive when we're forced to use the bleeding edge ALL the time, maybe they will fix this before 8.8.x is released.
(it's still in dev)
a lot of people will have the same issue I have when 8.8.0 is released unless the core maintainers fix this.

joseph.olstad’s picture

message from Drupal core 8.8.x: "Drupal core development requires Composer 1.9.0, but Composer 1.6.3 is installed."

luckily 'composer up' works for me from the drupalmoduleupgrader folder

this patch is helpful

gábor hojtsy’s picture

composer 1.6.3 is what I'm running and Drupal 8.8.x core does not allow me to do a composer up from the drupal core folder
however I can do a composer up from the drupalmoduleupgrader

Drupal 8.7.x did not have this problem with composer version 1.6.3 (default version provided with Ubuntu 18.04 LTS)

I don't know how would composer figure out what to do if the directory you are running it is not managed by composer. What does composer update mean then? How did it work with 8.7.x with a non-composer Drupal core setup?

It's pretty agressive when we're forced to use the bleeding edge ALL the time, maybe they will fix this before 8.8.x is released.
(it's still in dev)
a lot of people will have the same issue I have when 8.8.0 is released unless the core maintainers fix this.

What should be fixed in core? To be able to run composer update from a non-composer managed directory? If you git checkout a Drupal module into your repo how would composer know it is there and it needs to manage it? It did not even install it in the first place.

The previous version of the readme suggested using https://www.drupal.org/project/composer_manager to merge core composer with module composer data so its managed within the high level composer file, but as you can see on that project it is deprecated since Drupal 8.1 (3.5 years ago) because core provides the necessary pieces to require modules as composer dependencies.

gábor hojtsy’s picture

Title: improve usability of drupalmoduleupgrader , for those who only skim the README.txt » Warn people if neither core nor the module was installed with composer and so the dependencies are not available
gábor hojtsy’s picture

Title: Warn people if neither core nor the module was installed with composer and so the dependencies are not available » Warn people if neither core nor the module were installed with composer, so the dependencies are not available

gábor hojtsy’s picture

Status: Needs work » Fixed

I don't contest that this improves the situation if composer was not yet used with the module. Let's get this in and then see what people say with the new release.

joseph.olstad’s picture

Drupal 8.7.x core works with composer version 1.6.3
Drupal 8.8.x dev core does NOT work with composer version 1.6.3, requires minimum version 1.9.0 (bleeding edge version)

so, with 8.8.x , I CANNOT run 'composer up' from the root of drupal
however running 'composer up' from drupalmoduleupgrader does work with composer 1.6.3.

Composer 1.6.3 was released in 2018 , not very old at all, this is actually a very recent version of composer.

it is included in Ubuntu 18.04 repositories with millions of other people using Ubuntu 18.04 this is sure to cause more than some discomfort if 8.8.0 is released with this type of a constraint in december.

gábor hojtsy’s picture

#3075785: Update composer/composer to ^1.9.1 has some background info, if you are installing Drupal core with composer then 1.9.0 is not required, just if you are developing core, which is the case if you use a git checkout rather than installing Drupal with composer.

joseph.olstad’s picture

ah ok thanks Gabor, ya there was a dns failure in drupal.org yesterday so I cloned core because I could not download it.

explains it, so this is good news, I don't have to upgrade composer 'yet'. hopefully should be good for a while.

joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned

Thanks

Status: Fixed » Closed (fixed)

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