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

update vendors and adjust to seo bundle changes #255

Merged
merged 5 commits into from
May 3, 2014
Merged

update vendors and adjust to seo bundle changes #255

merged 5 commits into from
May 3, 2014

Conversation

dbu
Copy link
Member

@dbu dbu commented Apr 30, 2014

preparing with updated bundles

@dbu
Copy link
Member Author

dbu commented Apr 30, 2014

seo metadata extras editing is currently broken - i created Burgov/KeyValueFormBundle#2

@ElectricMaxxx
Copy link
Member

👍

@ElectricMaxxx
Copy link
Member

I think i will try to dive on my own into that part this evening or tomorrow Morning at work. Will have a look how it should work or what that bundle expects to get.

@lsmith77
Copy link
Member

lsmith77 commented May 1, 2014

guess still makes sense to merge?

@ElectricMaxxx
Copy link
Member

@dbu it's the reflection again that hits us in here. As you can see in the Exception Symfony\Cmf\Bundle\SeoBundle\Doctrine\Phpcr\SeoMetadata has no method addExtraName() and indeed that class does not have that method, but the Symfony\Cmf\Bundle\SeoBundle\Model\SeoMetadata has. So that exception is thrown, cause that check is done by a reflection, which does not work on extensions as i had to learn. So we can't really say if our signature of the adder are right or not, cause we didn't touch them by the form.

@ElectricMaxxx
Copy link
Member

... and symfony form goes that way only for values that are arrays. Could be a reason why it does not occur that much. Simple non-array are set by setters always.

@ElectricMaxxx
Copy link
Member

..., but even or adder would be found we would get an error cause as you can see in
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L489-L491
and
https://github.com/Burgov/KeyValueFormBundle/blob/master/Form/DataTransformer/HashToKeyValueArrayTransformer.php#L19-36
the value only would be set and as the first param.

So what to do?

@ElectricMaxxx
Copy link
Member

Tried to fix the last item by Burgov/KeyValueFormBundle#3

@dbu
Copy link
Member Author

dbu commented May 2, 2014

burgov said he would look into the issue today, so lets wait a moment to hear from him.

@dbu
Copy link
Member Author

dbu commented May 2, 2014

@ElectricMaxxx i think you are mistaken about the reflection: if i change the method to have just one argument, things work indeed fine, php sees the method of the parent class. (if it would not, reflection would be broken quite fundamentally)

@ElectricMaxxx
Copy link
Member

@dbu you are right, sorry. I do not see this part of code in the PropertyAccessor

    private function isAccessible(\ReflectionClass $class, $methodName, $parameters)
    {
        if ($class->hasMethod($methodName)) {
            $method = $class->getMethod($methodName);

            if ($method->isPublic() && $method->getNumberOfRequiredParameters() === $parameters) {
                return true;
            }
        }

        return false;
    }

That checks the existence and the number of parameters. So it just the discussion whit burgov is left.

@ElectricMaxxx
Copy link
Member

…of seo-bundle, it should be included in the composer.json on this level of the project
dbu added a commit that referenced this pull request May 3, 2014
update vendors and adjust to seo bundle changes
@dbu dbu merged commit 7a4665e into master May 3, 2014
@dbu dbu deleted the prepare-rc branch May 4, 2014 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants