This is a start to convert composer manager to Drupal 8, at least the UI works.

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new49.95 KB

Here is a patchfile, but for sure you could also get the relative clean commit history while porting.

cpliakas’s picture

Lot to take in! Thanks for the contribution and working on this.

nick_vh’s picture

@@ -251,24 +14,7 @@ function composer_manager_rebuild_form_submit($form, &$form_state) {
+  return Drupal::service('composer_manager')->loadLockFile();

Don't we need to add an initial slash? Had issues without the initial slash when I ported my module.

Looks very complete otherwise! Testing it

nick_vh’s picture

StatusFileSize
new52.5 KB

Some changes happened in Drupal 8 so this port did not fully work anymore (basically it crashed but foundation was good)

Attached is a patch that makes it work again and we now have a first module that depends on it : https://drupal.org/project/aws_sqs

Please commit this to a branch of 8.x-1.x so we can start using this for future Drupal 8 modules.

Also, I added an EventListener so it loads when it does a hook_init, but this seemed not to work properly because in aws_sqs I still need to call the composer_autoload function. Anyway, food for thought! :)

nick_vh’s picture

StatusFileSize
new69.24 KB

A screenshot to show that it works ;-)

Composer_Manager___drupal8.dev_.png

cpliakas’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Needs review » Needs work

Committed patch at #2054947-4: Convert composer manager to Drupal 8 as the 8.x-1.x branch.

Marking as needs work just because it probably does and will as D8 continues to evolve.

kostajh’s picture

@Nick_vh what version of D8 are you working with? I've tried enabling Composer Manager on 8.0-alpha8, and on a clean install of bf3e9cfaaafa6179 (Nov 2), but whenever I try enabling I get this error message https://drupal.org/documentation/rebuild.

kostajh’s picture

Nevermind, I realized that after enabling Composer Manager with Drush, I had to run drush composer-json-rebuild.

dmouse’s picture

I add "composer_manager.local_task.yml" for create admin tabs.
I changed the class SettingsForm, the class SystemConfigFormBase not exist more.
I add submitForm in SettingsForm for save configuration
Update composer_manager.routing.yml with tag _title in settingsForm
I changed drupal_get_form to "\Drupal::formBuilder()->getForm", drupal_get_form is deprecated.

dmouse’s picture

Issue summary: View changes
StatusFileSize
new3.58 KB
dmouse’s picture

Idea:
In drupal now has a composer.json file which already has dependencies, I think it should be compared with contributed modules dependencies.

BTW It would be interesting to run commands using the UI

- http://ankitchauhan22.blogspot.mx/2013/02/run-symfony-command-from-contr...
- https://github.com/composer/composer/blob/master/src/Composer/Command/Up...

damiankloip’s picture

For sanity's sake, I would recommend creating separate follow up issues from now on against the 8.x branch. This will make a better issue trail in the commit logs too.

dawehner’s picture

For sanity's sake, I would recommend creating separate follow up issues from now on against the 8.x branch. This will make a better issue trail in the commit logs too.

+ 100

kostajh’s picture

Is there any reason for this issue to stay open then? If so, the summary should be updated.

dawehner’s picture

Status: Needs work » Fixed

I would say no.

Status: Fixed » Closed (fixed)

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