Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Symfony 3.0 #232

Merged
merged 2 commits into from
Dec 7, 2015

Conversation

pfrenssen
Copy link
Collaborator

Pull request for #225.

On recent build jobs the following error occurs:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]                                                                                   
  The file "src/Drupal/DrupalExtension/ServiceContainer/config/services.yml" does not contain valid YAML.

  [Symfony\Component\Yaml\Exception\ParseException]                                                                           
  The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 37 (near "- @drupal.random").

Starting in Symfony/Yaml 3.0 strings starting with an '@' need to be quoted.

@pfrenssen
Copy link
Collaborator Author

This problem will not occur for people that use Behat 3.0.15 or lower since those versions still require symfony/yaml ~2.1. Support for Symfony 3 was added in PR #801: Allow behat to work with Symfony3, so until 3.0.16 is released it will only affect people that are using the current master branch.

Let's be ready in any case.

@pfrenssen
Copy link
Collaborator Author

There were multiple affected Yaml files. There is also a strange error occurring which I cannot replicate locally:

[ReflectionException]
Class Drupal\Driver\Cores\Drupal6 does not exist

I've increased the debugging information on Travis, hope to get some pointers from that. It's strange that it even tries to load the Drupal6 class for a Drupal 7 test.

@pfrenssen
Copy link
Collaborator Author

For some reason Composer resolved DrupalDriver to version 1.0.8. In composer.json the version was set to ~1.0@dev which I assume is intended to resolve to the latest development version on 1.x. On my system this works as expected. I've updated it to dev-master to see if this makes any difference.

@pfrenssen
Copy link
Collaborator Author

Hah! This one's green but now it reverted back to symfony/yaml version 2.8.0! That explains why an ancient version of DrupalDriver was used: apparently something changed in the composer dependencies after 1.0.8 that makes it incompatible with Symfony 3.

@pfrenssen
Copy link
Collaborator Author

This is probably it: commit 84c1ff5c. Will make a PR on the DrupalDriver side.

@pfrenssen
Copy link
Collaborator Author

The last test run proves that it now works using Symfony 3.0 on PHP5.5+, but it didn't fall back to 2.8 on PHP5.4, hence the failure.

@pfrenssen
Copy link
Collaborator Author

In any case the actual changes (the quoting of the yaml files) should be harmless on either version.

@pfrenssen
Copy link
Collaborator Author

Woot! Persistence is the key to success!

Now that it's proven that it works, I'll clean up the branch.

@jhedstrom
Copy link
Owner

I've merged jhedstrom/DrupalDriver#72

@pfrenssen
Copy link
Collaborator Author

Actually, let's wait for the sister pull request in DrupalDriver (jhedstrom/DrupalDriver#72), then I can rebase this branch and get rid of all the exploratory commits easily.

@pfrenssen pfrenssen force-pushed the symfony-3-compatibility branch from 494c019 to a9a5a08 Compare December 7, 2015 19:48
@pfrenssen
Copy link
Collaborator Author

Cool, thanks @jhedstrom ! I've rebased the branch and removed all unnecessary cruft. This does not prefer any Symfony version over another now, so the actual version used will be determined by the other dependencies that a project uses. At least it is now proven to be compatible with both.

@jhedstrom jhedstrom added this to the 3.2.0 release milestone Dec 7, 2015
@jhedstrom
Copy link
Owner

From what I can tell, only certain Symfony 3.0 components are used here (finder for one). The YAML component is still at 2.8 for the travis builds. I think this is good for now though as mentioned above it has manually been confirmed to work with 3.0.

Thanks!

jhedstrom added a commit that referenced this pull request Dec 7, 2015
@jhedstrom jhedstrom merged commit 78a43a6 into jhedstrom:master Dec 7, 2015
@pfrenssen pfrenssen deleted the symfony-3-compatibility branch December 8, 2015 13:10
jhedstrom added a commit that referenced this pull request Dec 22, 2015
Compatibility with Symfony 3.0

Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>
@jhedstrom
Copy link
Owner

@pfrenssen are you able to run Behat, or the Drupal Drivers with Symfony 3? I am seeing increasing incompatibilities with Drupal 8 (see #244 test fails for instance).

@pfrenssen
Copy link
Collaborator Author

I only have a Drupal 7 project that uses Symfony 3 dependencies. My D8 projects use Symfony 2.7 for Drupal 8.0.x and Symfony 2.8 for Drupal 8.1.x.

@jhedstrom
Copy link
Owner

Ah, that makes sense. Thanks!

@jhedstrom jhedstrom mentioned this pull request May 2, 2017
xurizaemon pushed a commit to xurizaemon/drupalextension that referenced this pull request Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants