When execute following commands:

  • php modules/composer_manager/scripts/init.php
  • composer drupal-update

Composer will report error message as below:

> Drupal\composer_manager\Composer\Command::update
Loading composer repositories with package information
Updating dependencies (including require-dev)         
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package drupal/filter could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

From this point of view, we should say require "drupal/core", but not "drupal/filter".

CommentFileSizeAuthor
#2 php-require_drupal_core-2714169-2.patch242 byteshswong3i

Comments

hswong3i created an issue. See original summary.

hswong3i’s picture

Status: Active » Needs review
StatusFileSize
new242 bytes
hass’s picture

Why "core"? PHP need the core filter module. If this is not enabled the modules may not work.

hswong3i’s picture

First of all from Drupal 7 to Drupal 8 point of view:

  • *.make become composer.json, handling source code dependency management
  • *.info become *.info.yml, handling functionality dependency management

Since "drupal/filter" is defined as "replace" (see https://getcomposer.org/doc/04-schema.md#replace) inside composer.json (see http://cgit.drupalcode.org/drupal/tree/core/composer.json?h=8.1.x), it is just a sub-package of "drupal/core". Therefore from source code dependency management point of view, we should say depend on its parent package "drupal/core".

On the other hand, PHP need the core filter module in order to get functioning, so its functionality dependency management should defined within php.info.yml. Therefore once enable PHP, Drupal will understand that also enable core filter module.

Long story short, composer.json !== php.info.yml

hass’s picture

Great. Many thanks for the explaination!

  • hass committed 304022b on 8.x-1.x authored by hswong3i
    Issue #2714169 by hswong3i: composer.json should require "drupal/core"
    
hass’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

WegPast’s picture

So, I don't know if it's related but I was fighting against this error for a while even with the patch applied...

The only workaround I found was to replace the "drupal/filter": "self.version", line with "drupal/filter": "*", in the core/composer.json (Yeah I know that's bad to change core files...)

On a Drupal 8.2.6, using latest Composer version

Hope this workaround will be usefull for someone. And maybe I'll get an explanation of what happened :p