The require jqueryvalidate in the composer.json file breaks composer integration.

Comments

larowlan created an issue. See original summary.

quiron’s picture

Hi,

I have a similar issue that seems to apear randomly. I solved with a

composer clear-cache

Any idea of what can be going on?

davy-r’s picture

Same issue here (composer 1.2.0), but composer clear-cache doesn't solve the issue for me..

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

  Problem 1
    - Installation request for drupal/clientside_validation 8.1.x-dev -> satisfiable by drupal/clientside_validation[8.1.x-dev].
    - drupal/clientside_validation 8.1.x-dev requires jqueryvalidate ~1.14.0 -> no matching package found.

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.
jelle_s’s picture

Status: Active » Needs review

My guess is that you need to re-define the jqueryvalidate in your root composer.json file, as repositories are not resolved recursively (see https://getcomposer.org/doc/04-schema.md#repositories).

Can you check if that works?

davy-r’s picture

Status: Needs review » Needs work

Thanks, that's correct, when I re-define the jqueryvalidate in my root composer.json the dependency can be resolved. But imho it is a workaround and not a neat solution to this issue.

Another thing that I noticed is that the jqueryvalidate dependency is downloaded to "libraries/jqueryvalidate", but the cdn version is being loaded.

itamair’s picture

+subscribe

greenskunk’s picture

The project page states the following:

clientside_validation_jquery

This modules adds the jQuery Validation Plugin,
to install download the latest version
and extract the archive to the js/lib of this sub module.

If you don't download the library, it will be hot linked to the CDN version.

  • This text would have to be updated for the the various ways people can build sites (FTP, Drush, Composer) with Drupal.
  • I'll look into this later but this doesn't appear to locate the jqueryvalidate library in the libraries folder so it is using the CDN version instead.
  • For people building a Drupal 8 site using composer, there is an issue here in that it can't install the dependency.

An Option

Don't make it a composer dependency but have the module check the libraries folder for jqueryvalidate.If it doesn't exist then have it output something on the Status Report page using hook_requirements https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

Pascal-’s picture

Add this to your composer.json for an easy fix:

    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "jqueryvalidate": {
            "type": "package",
            "package": {
                "name": "jqueryvalidate",
                "version": "1.15.0",
                "type": "drupal-library",
                "dist": {
                    "url": "https://jqueryvalidation.org/files/jquery-validation-1.15.0.zip",
                    "type": "zip"
                }
            }
        }
    }
nikunjkotecha’s picture

StatusFileSize
new1.07 KB

For now, removing composer require from module, readme and other stuff will be managed in https://www.drupal.org/node/2895666

This won't break existing setups as CDN version is already made available if not available in module.

nikunjkotecha’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: 2898885-9.patch, failed testing. View results

  • nikunjkotecha committed 88387dd on 8.x-1.x
    Issue #2784069 by nikunjkotecha: Composer integration broken
    
nikunjkotecha’s picture

Status: Needs work » Fixed

Confirmed the fix above in https://www.drupal.org/node/2899231#comment-12244123, patches are now passing if the code is proper :)

Status: Fixed » Closed (fixed)

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

nikunjkotecha’s picture

Status: Closed (fixed) » Needs work
Related issues: +#2895666: Allow jQuery Validation library to be installed outside of module folder

Issue still left with the readme update. Since the fix to remove composer dependency was added in this ticket, reopening this one instead of fixing in 2895666.

nikunjkotecha’s picture

StatusFileSize
new7.48 KB
  • Updated README
  • Updated clientside_validation_jquery.libraries.yml as per updated README
  • Refactored code in hook_library_info_alter to support all scenarios
nikunjkotecha’s picture

Status: Needs work » Needs review
nikunjkotecha’s picture

Status: Needs review » Fixed

I feel like I'm messing up a lot today. I mentioned that README and rest all will be fixed as part of other ticket here https://www.drupal.org/project/clientside_validation/issues/2784069#comm...

Closing this again and adding patch + changes there.

Sorry for all the unnecessary notifications.

  • nikunjkotecha committed 88387dd on 2784069
    Issue #2784069 by nikunjkotecha: Composer integration broken
    

Status: Fixed » Closed (fixed)

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