When I try to download the module with composer, it returns an error.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install drupal/printable 1.0.0
    - Conclusion: remove symfony/css-selector v2.8.27
    - Conclusion: don't install symfony/css-selector v2.8.27
    - wa72/htmlpagedom 1.1.x-dev requires symfony/css-selector >=2.3,<2.8 -> satisfiable by symfony/css-selector[2.3.x-dev, 2.4.x-dev, 2.5.x-dev, 2.6.x-dev, 2.7.x-dev].
    - wa72/htmlpagedom v1.1.3 requires symfony/css-selector >=2.3,<2.8 -> satisfiable by symfony/css-selector[2.3.x-dev, 2.4.x-dev, 2.5.x-dev, 2.6.x-dev, 2.7.x-dev].
    - Can only install one of: symfony/css-selector[2.3.x-dev, v2.8.27].
    - Can only install one of: symfony/css-selector[2.4.x-dev, v2.8.27].
    - Can only install one of: symfony/css-selector[2.5.x-dev, v2.8.27].
    - Can only install one of: symfony/css-selector[2.6.x-dev, v2.8.27].
    - Can only install one of: symfony/css-selector[2.7.x-dev, v2.8.27].
    - Conclusion: don't install symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - Conclusion: don't install drupal/printable 1.0.0|remove symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - Conclusion: don't install drupal/printable 1.0.0|don't install symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - Installation request for symfony/css-selector (locked at v2.8.27, required as ~2.8) -> satisfiable by symfony/css-selector[v2.8.27].
    - Conclusion: don't install drupal/printable 1.0.0|remove symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - Conclusion: don't install drupal/printable 1.0.0|don't install symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - Installation request for drupal/printable ^1.0 -> satisfiable by drupal/printable[1.x-dev, 1.0.0].
    - Conclusion: remove symfony/dom-crawler v3.3.6|install wa72/htmlpagedom 1.1.x-dev|install wa72/htmlpagedom v1.1.3
    - drupal/printable 1.x-dev requires wa72/htmlpagedom 1.1.* -> satisfiable by wa72/htmlpagedom[1.1.x-dev, v1.1.0, v1.1.1, v1.1.2, v1.1.3].
    - wa72/htmlpagedom v1.1.0 requires symfony/dom-crawler ~2.3 -> satisfiable by symfony/dom-crawler[2.3.x-dev, 2.4.x-dev,..............

CommentFileSizeAuthor
#3 error-dependencies-composer-2912294-3.patch285 bytesfmb

Comments

cbccharlie created an issue. See original summary.

maxq10’s picture

I'm seeing a very similar (if not exactly the same) error when I try to install this using composer as well.

fmb’s picture

Status: Active » Needs review
StatusFileSize
new285 bytes

Apparently branch 1.1 of wa72/htmlpagedom is incompatible with the versions of symfony/css-selector we are currently using. Would this module work with branch 1.3 (see attached patch)?

pmoncel’s picture

Yes the module is compatible with wa72/htmlpagedom branch 1.3.
However some bugs : when 'Close window after sending to printer' is checked, the page is not sent to printer.

cbccharlie’s picture

I use the following command to download the module:

composer require drupal/printable

How can I apply the patch on the composer.json of the module for testing the patch?

fmb’s picture

cbccharlie: you can apply patches with cweagans/composer-patches. However, since patches are applied after depencies are computed and packages are dowloaded, I do not think it will solve your issue right now: only when maintainers decide to commit it will you notice its effects on repositories and Composer—namely, no more dependencies errors (hopefully). Bugs affecting modules composer.json files are indeed tough to test before committing for this reason.

What you can do, though, is testing the Printable module to make sure it behaves correctly with newer versions of wa72/htmlpagedom:

  • install dependencies (latest versions): composer require wa72/htmlpagedom smalot/pdfparser.
  • «Manually» install the Printable module: drush dl printable.
  • Report here the results of your tests, as pmoncel did.
cbccharlie’s picture

Yes, I know cweagans/composer-patches and I can confirm that patches are applied after dependencies.

It was in case there was another solution.

Thanks fmb.

cbccharlie’s picture

Priority: Major » Critical
huahaiyang’s picture

I did the following:

* install dependencies (latest versions): composer require wa72/htmlpagedom smalot/pdfparser.
* «Manually» install the Printable module: drush dl printable.
* manually change composer.json to use wa72/htmlpagedom smalot/pdfparser, and it seems to work.
* drush en printable

It seems to solve the problem

donm’s picture

For Drupal 8.4.3, with Composer and Drush 9, this is my experience in trying to install Printable:

- "composer require drupal/printable" shows an error message similar to the original issue, pointing at the css-selector v3.4.2: "- Can only install one of: symfony/css-selector[2.4.x-dev, v3.4.2]."

- I then followed the patch in #3 (in part), using Composer to install wa72/htmlpagedom v. 1.3.0 and the sma... module. Then tried to install printable, with this result:

Problem 1
- Installation request for wa72/htmlpagedom (locked at v1.3.0, required as ^1.3) -> satisfiable by wa72/htmlpagedom[v1.3.0].
- drupal/printable 1.x-dev requires wa72/htmlpagedom 1.1.* -> satisfiable by wa72/htmlpagedom[1.1.x-dev].
- drupal/printable 1.0.0 requires wa72/htmlpagedom 1.1.* -> satisfiable by wa72/htmlpagedom[1.1.x-dev].
- Conclusion: don't install wa72/htmlpagedom 1.1.x-dev
- Installation request for drupal/printable ^1.0 -> satisfiable by drupal/printable[1.x-dev, 1.0.0].

- Then tried to install wa72/htmlpagedom v. 1.1.* (per the other item in the patch), which didn't work, and generated a long error message pointing again to symfony/css-selector v. 3.4.2.

- Per the item about using Drush to download printable, got an error message saying "Drush dl" is deprecated and to use Composer. I suppose I could download the thing manually, but for now I need to move on to other issues (upgrading Drupal 7 to Drupal 8).

- I also tried: uninstalled wa72... v1.3.0 and tried to install v.1.1.*, but that failed with the css-selector v.3.4.2 incompatibility. (When I'm brave, I'll see whether it's possible to downgrade that version.)

nigelcunningham’s picture

Status: Needs review » Fixed

Tested and applied; thanks. I'll look at other issues and do further testing before preparing a new release.

  • FMB authored 22d1a30 on 8.x-1.x
    Issue #2912294 by FMB: Error dependencies with composer
    

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Version: 8.x-1.0 » 8.x-1.x-dev