acf-pro-installer icon indicating copy to clipboard operation
acf-pro-installer copied to clipboard

Cannot install beta or release candidate version

Open alexisferat opened this issue 6 years ago • 7 comments

Steps to reproduce:

  1. In the repositories field, set the ACF package version to 5.7.0-RC4
  2. In the require field, set constraint to ^5.7
  3. Execute composer update advanced-custom-fields/advanced-custom-fields-pro

Result:

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

  Problem 1
    - The requested package advanced-custom-fields/advanced-custom-fields-pro ^5.7 exists as advanced-custom-fields/advanced-custom-fields-pro[5.6.10] but these are rejected by your constraint.

Same problem when doing composer require advanced-custom-fields/advanced-custom-fields-pro:

[InvalidArgumentException]
Could not find a version of package advanced-custom-fields/advanced-custom-fields-pro matching your minimum-stability (stable). Require it with an explicit version constraint allowing its desired stability.

alexisferat avatar Jul 08 '18 18:07 alexisferat

+1, just tried to install 5.7.0. Edit: It works now: Apparently this was a separate issue with global hirak/presistissimo package for composer: https://github.com/PhilippBaschke/acf-pro-installer/pull/20

strarsis avatar Jul 12 '18 17:07 strarsis

same problem here - trying to install the 5.8.0 beta1. editing/commenting the code in the validateVersion method in the Plugin.php does the trick.

gaambo avatar Oct 17 '18 13:10 gaambo

Still not working for 5.8.0-beta2:

[UnexpectedValueException]                                                                                                                              
  The version constraint of advanced-custom-fields/advanced-custom-fields-pro should be exact (with 3 or 4 digits). Invalid version string "5.8.0-beta2"

tiwac100 avatar Nov 12 '18 09:11 tiwac100

same problem here - trying to install the 5.8.0 beta1. editing/commenting the code in the validateVersion method in the Plugin.php does the trick.

Could you go into detail how you got this working @gaambo? I think I commented the right code, but I get the following error message:

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

  Problem 1
    - The requested package advanced-custom-fields/advanced-custom-fields-pro 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.
 - It's a private package and you forgot to add a custom repository to find it

I add the repository like this:

    {
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.10-beta2",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
        },
        "require": {
          "philippbaschke/acf-pro-installer": "^1.0",
          "composer/installers": "^1.0"
        }
      }
    }

stefthoen avatar Nov 13 '18 08:11 stefthoen

Could you go into detail how you got this working @gaambo? I think I commented the right code, but I get the following error message @stefthoen

sure and also for anyone else reading this: in vendor/philippbaschke/acf-pro-installer/src/ACFProInstaller/Plugin.php i commented line 185-195 out. this method checks the version to be a proper semantic version (with 3 or 4 digits). it would need a pull request to update this method to also allow beta version strings. by commenting it out you bypass the version check - so that's not a future-proof solution.

after that i added the repository in composer.json like this:

{
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.0-beta1",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
        },
        "require": {
          "philippbaschke/acf-pro-installer": "^1.0",
          "composer/installers": "^1.0"
        }
      }
    }

and the dependency as advanced-custom-fields/advanced-custom-fields-pro": "5.8.0-beta1

this works for me - but i only got it set up in one project, so no extensive testing right now.

im pretty busy the next few weeks but maybe i'll come around to do a pull request for this method soon. we'd also need to check the minimum stability options and deny beta/alpha versions then.

gaambo avatar Nov 13 '18 11:11 gaambo

Just to add that it worked for me after doing all of the above, but using this as the dependency:

"advanced-custom-fields/advanced-custom-fields-pro": "*@beta"

The only problem is making sure that my edits to acf-pro-installer don't get overwritten!

robrecord avatar Dec 13 '18 18:12 robrecord

As there is a PR waiting I use something like this:

{
      "type": "package",
      "package": {
        "name": "advanced-custom-fields/advanced-custom-fields-pro",
        "version": "5.8.0-beta3",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download"
        },
        "require": {
          "philippbaschke/acf-pro-installer": "dev-master#9cac3d3ed8217eb2c49aecd0941ab82bf0374f58",
          "composer/installers": "^1.0"
        }
      }
    },

the specific commit ID of the @jezemery PR. You don't have to edit any file.

palmiak avatar Feb 03 '19 14:02 palmiak