2012-11-19 3 views
2

심포니 2.0에서 2.1로 업데이트 한 이후 Facebook을 통해 로그인 할 수 없습니다. 심포니 내 로그인 페이지와 디스플레이에이 오류를 저를 리디렉션FOSFacebookBunlde는 "알림 : 공급자 doctrine dbal lib Doctrine DBAL Statement.php 줄 103"에있는 문자열 변환에 대한 배열을 던졌습니다.

[2012-11-19 09:17:48] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". [] [] 
[2012-11-19 09:17:48] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] [] 
[2012-11-19 09:17:48] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". [] [] 
[2012-11-19 09:17:49] request.INFO: Matched route "fos_facebook_security_check" (parameters: "_controller": "Strict\UserBundle\Controller\LoginController::loginFbAction", "_locale": "pl", "_route": "fos_facebook_security_check") [] [] 
[2012-11-19 09:17:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". [] [] 
[2012-11-19 09:17:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] [] 
[2012-11-19 09:17:49] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.facebookId AS facebookId18, t0.name AS name19, t0.text AS text20, t0.location AS location21, t0.picturePath AS picturePath22, t0.www AS www23, t0.language AS language24, t0.facebookWww AS facebookWww25, t0.male AS male26, t0.reviewsCount AS reviewsCount27, t0.postsCount AS postsCount28, t0.emailEnabled AS emailEnabled29, t0.messagesEnabled AS messagesEnabled30, t0.wwwNofollow AS wwwNofollow31, t0.facebookWwwNofollow AS facebookWwwNofollow32, t0.yearBirth AS yearBirth33, t0.lastModified AS lastModified34, t0.picture_id AS picture_id35 FROM fos_user t0 WHERE t0.facebookId = ? LIMIT 1 ["000_facebook_id_here_0000"] [] 
[2012-11-19 09:17:51] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.facebookId AS facebookId18, t0.name AS name19, t0.text AS text20, t0.location AS location21, t0.picturePath AS picturePath22, t0.www AS www23, t0.language AS language24, t0.facebookWww AS facebookWww25, t0.male AS male26, t0.reviewsCount AS reviewsCount27, t0.postsCount AS postsCount28, t0.emailEnabled AS emailEnabled29, t0.messagesEnabled AS messagesEnabled30, t0.wwwNofollow AS wwwNofollow31, t0.facebookWwwNofollow AS facebookWwwNofollow32, t0.yearBirth AS yearBirth33, t0.lastModified AS lastModified34, t0.picture_id AS picture_id35 FROM fos_user t0 WHERE t0.email = ? LIMIT 1 ["my_email_address_here"] [] 
[2012-11-19 09:17:52] doctrine.DEBUG: "START TRANSACTION" [] [] 
[2012-11-19 09:17:52] doctrine.DEBUG: "ROLLBACK" [] [] 
[2012-11-19 09:17:52] security.INFO: Authentication request failed: Notice: Array to string conversion in vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php line 103 [] [] 
[2012-11-19 09:17:52] security.DEBUG: Redirecting to fos_user_security_login [] [] 

두 SELECT SQL 쿼리가 위의 어떤 오류를 일으킬 반환하지 않습니다 : 아래 내 로그 파일을 볼 수 있습니다

Notice: Array to string conversion in vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php line 103

결과 (phpmyadmin에서 확인).

Composer.json :

"require": { 
    "php": ">=5.3.3", 
    "symfony/symfony": "2.2.*", 
    "doctrine/orm": ">=2.2.3,<2.4-dev", 
    "doctrine/doctrine-bundle": "1.0.*", 
    "twig/extensions": "1.0.*", 
    "symfony/assetic-bundle": "2.1.*", 
    "symfony/swiftmailer-bundle": "2.1.*", 
    "symfony/monolog-bundle": "2.1.*", 
    "sensio/distribution-bundle": "2.2.*", 
    "sensio/framework-extra-bundle": "2.2.*", 
    "sensio/generator-bundle": "2.2.*", 
    "jms/security-extra-bundle": "1.3.*", 
    "jms/di-extra-bundle": "1.2.*", 
    "facebook/php-sdk": "dev-master", 
    "friendsofsymfony/user-bundle": "*", 
    "friendsofsymfony/facebook-bundle": "dev-master",   
    "besimple/i18n-routing-bundle": "dev-master", 
    "gregwar/captcha-bundle": "dev-master" 
}, 

내가 잘못 방법과 오류를 찾을 수 있습니다 모르겠어요 솔직히 말해서. 추가 데이터/설정 파일이 필요한 경우 코멘트를 게시하십시오.

답변

1

안녕하세요. 해결책을 찾았습니다. 문제는 Facebook이 User 엔티티에로 전달할 picture 문자열 속성을 반환하지 않는다는 것입니다.

이미지 URL이 포함 된 picture 문자열 속성이 있습니다. 지금은 포함되어

string; If the "October 2012 Breaking Changes" migration setting is enabled for your app, this field will be an object with the url and is_silhouette fields; is_silhouette is true if the user has not uploaded a profile picture

내 setFBdata는 다음과 같이 :

public function setFBData($fbdata) 
{ 
    ... 
    if (isset($fbdata['picture'])) 
    { 
     $this->setPicturePath($fbdata['picture']); 
    } 

} 

당신이 문자열 필드에 객체/배열을 설정하려고했다 볼 수 있듯이.

관련 문제