Problem/Motivation

Same as #2269385: DependencyInjection YamlFileLoader is out of date but for Symfony the upgrade from 2.4 to 2.6.

Command used to produce the changes to the Symfony YamlFileLeader (in the symfony repo):
git diff v2.4.0..v2.6.0 src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php > /tmp/symfony-yaml-file-loader-2.4-2.6-do-not-test.diff

Proposed resolution

Some of them can be applied with patch -p6 < /tmp/symfony-yaml-file-loader-2.4-2.6-do-not-test.diff (cd core/lib/Drupal/Core/DependencyInjection before). Manual editing still required though.

Remaining tasks

Review.

User interface changes

None.

API changes

None.

Comments

znerol’s picture

Status: Active » Needs review
StatusFileSize
new9.87 KB
znerol’s picture

dawehner’s picture

Status: Needs review » Closed (duplicate)

Let's mark it as duplicate, @znerol was okay with that #2366043: Upgrade to Symfony 2.6.0-beta1

znerol’s picture

Title: Update DependencyInjection YamlFileLoader for Symfony 2.5 » Update DependencyInjection YamlFileLoader for Symfony 2.6
Status: Closed (duplicate) » Needs work

Reopening because #2366043: Upgrade to Symfony 2.6.0-beta1 did not take care of core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php which is a modified copy of the symfony YamlFileLoader.

Setting to needs work, because the patch in #1 contains unrelated hunks.

znerol’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new8.54 KB
new7.14 KB

Reworked for the upgrade from 2.4 to 2.6.

lussoluca’s picture

Status: Needs review » Needs work

The patch looks good, only one thing doesn't work. In Symfony 2.5 you could define a service which decorates another one (http://symfonytest.readthedocs.org/en/latest/components/dependency_injec...). On our implementation this doesn't work, do you know if we have done other alterations to the service container?

znerol’s picture

Status: Needs work » Needs review

I cannot reproduce #6.

Consider the bar service decorating foo in sites/default/services.yml:

services:
  foo:
    class: stdClass
  bar:
    public: false
    class: ArrayObject
    decorates: foo
    arguments: ["@bar.inner", "other-stuff"]

Produces the following code in the compiled container when the patch is applied:

    protected function getFooService()
    {
        return $this->services['foo'] = new \ArrayObject(new \stdClass(), 'other-stuff');
    }

In contrast without the patch, service decoration does not work (which is expected behavior):

    protected function getFooService()
    {
        return $this->services['foo'] = new \stdClass();
    }
lussoluca’s picture

Ok it was a mine misconfiguration :-/

It works as expected

For me is RTBC

hussainweb’s picture

Issue summary: View changes
StatusFileSize
new8.54 KB
new6.59 KB

I generated a new diff after #2377281: Upgrade to Symfony 2.6 stable and also updated the diff command in issue summary. Files attached...

znerol’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php
@@ -86,6 +86,10 @@ public function load($file)
+                throw new InvalidArgumentException(sprintf('The "parameters" key should contain an array in %s. Check your YAML syntax.', $resource));

There is no $resource here, use $file instead.

hussainweb’s picture

Status: Needs work » Needs review
StatusFileSize
new849 bytes
new6.59 KB

Thanks for catching that. :)

znerol queued 11: update-2375339-11.patch for re-testing.

andyceo queued 11: update-2375339-11.patch for re-testing.

hussainweb’s picture

This might needmore work when #2414235: Upgrade to Symfony 2.6.4 goes in.

Berdir queued 11: update-2375339-11.patch for re-testing.

dawehner’s picture

Is this really still applying?

Fabianx queued 11: update-2375339-11.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 11: update-2375339-11.patch, failed testing.

Status: Needs work » Needs review

znerol queued 11: update-2375339-11.patch for re-testing.

dawehner’s picture

Status: Needs review » Closed (duplicate)

This is now resolved as part of #2470693: Upgrade to Symfony 2.7.0