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

Warning: strlen() expects parameter 1 to be string, resource given #29

Closed
jenyak opened this issue Jul 10, 2017 · 2 comments
Closed

Warning: strlen() expects parameter 1 to be string, resource given #29

jenyak opened this issue Jul 10, 2017 · 2 comments

Comments

@jenyak
Copy link

jenyak commented Jul 10, 2017

Getting an error Warning: strlen() expects parameter 1 to be string, resource given while trying to get an object with the type ip

config

php-fpm 7.0
postresql 9.6.3
darsyn/ip                                3.3.0 
doctrine/annotations                     v1.4.0  
doctrine/cache                           v1.6.1 
doctrine/collections                     v1.4.0
doctrine/common                          v2.7.2 
doctrine/dbal                            v2.5.12
doctrine/doctrine-bundle                 1.6.8
doctrine/doctrine-cache-bundle           1.3.0
doctrine/inflector                       v1.1.0  
doctrine/instantiator                    1.0.5  
doctrine/lexer                           v1.0.1
doctrine/orm                             v2.5.6

Stack Trace

[1] Symfony\Component\Debug\Exception\ContextErrorException: Warning: strlen() expects parameter 1 to be string, resource given
at n/a
    in vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 44

at Symfony\Component\Debug\ErrorHandler->handleError('2', 'strlen() expects parameter 1 to be string, resource given', 'vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php', '44', array('value' => resource, 'toType' => 'ip'))
    in  line 

at strlen(resource)
    in vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 44

at Doctrine\DBAL\Types\ConversionException::conversionFailed(resource, 'ip')
    in vendor/darsyn/ip/src/Doctrine/IpType.php line 58

at Darsyn\IP\Doctrine\IpType->convertToPHPValue(resource, object(PostgreSQL92Platform))
    in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 131

at Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateRowData(array('id_1' => '1', 'date_2' => '2017-07-10 10:54:32', 'ip_3' => resource, 'value_4' => '6'), array())
    in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 69

at Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator->hydrateAllData()
    in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php line 147

at Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll(object(PDOStatement), object(ResultSetMapping), array())
    in vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php line 720

at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(array('id' => '1'), null)
    in vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php line 730

at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadById(array('id' => '1'))
    in vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php line 462

at Doctrine\ORM\EntityManager->find('AppBundle\Entity\MyEntity', array(), null, null)
    in vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 154

at Doctrine\ORM\EntityRepository->find('1')
    in src/AppBundle/Controller/TestController.php line 21

at AppBundle\Controller\TestController->testAction(object(Request))
    in  line 

at call_user_func_array(array(object(TestController), 'testAction'), array(object(Request)))
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 144

at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 64

at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 69

at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
    in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 185

at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
    in web/app_dev.php line 33
@zanbaldwin
Copy link
Member

I've fixed this issue, but still working on issue #28 - the fix for both will be released at the same time.

Binary data in PostgreSQL is a pain.

@zanbaldwin
Copy link
Member

This has been fixed in version 3.3.1 - sorry for the delay and thanks for reporting it!

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

No branches or pull requests

2 participants