In Symfony2 I'm trying to implement FOS\OAuthServerBundle, but am getting a weird error. After following the guide here and also the official guide on GitHub, I'm met with an error that says:
Unrecognized field: randomId
500 Internal Server Error - ORMException
This is a protected variable in the Client Entity/Model in FOS\OAuthServerBundle. I must be missing something simple here, but for the life of me I can not figure out what.
Has anyone else experienced a similar error to this?
This error happens when trying to go to:
http://symfony.local/app_dev.php/oauth/v2/token?grant_type=client_credentials&client_id=fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk&client_secret=[secret redacted]
Stack trace
Doctrine\ORM\ORMException: Unrecognized field: randomId
at n/a
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 100
at Doctrine\ORM\ORMException::unrecognizedField('randomId')
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1681
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionStatementColumnSQL('randomId', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1610
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionStatementSQL('randomId', 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1701
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectConditionSQL(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1115
at Doctrine\ORM\Persisters\BasicEntityPersister->getSelectSQL(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, '0', '1', null, null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 746
at Doctrine\ORM\Persisters\BasicEntityPersister->load(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'), null, null, array(), '0', '1', null)
in /home/johnny/Development/symfonyProject/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196
at Doctrine\ORM\EntityRepository->findOneBy(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Entity/ClientManager.php line 55
at FOS\OAuthServerBundle\Entity\ClientManager->findClientBy(array('id' => 'fd87dddb-6c29-11e4-90f3-b8ca3aa16897', 'randomId' => 'fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk'))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Model/ClientManager.php line 41
at FOS\OAuthServerBundle\Model\ClientManager->findClientByPublicId('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Storage/OAuthStorage.php line 102
at FOS\OAuthServerBundle\Storage\OAuthStorage->getClient('fd87dddb-6c29-11e4-90f3-b8ca3aa16897_fzhfyllumw0kwwgkocg80wkg8sc4ko0soww0cks4gc0ogggk')
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth2-php/lib/OAuth2/OAuth2.php line 707
at OAuth2\OAuth2->grantAccessToken(object(Request))
in /home/johnny/Development/symfonyProject/vendor/friendsofsymfony/oauth-server-bundle/FOS/OAuthServerBundle/Controller/TokenController.php line 40
at FOS\OAuthServerBundle\Controller\TokenController->tokenAction(object(Request))
in line
at call_user_func_array(array(object(TokenController), 'tokenAction'), array(object(Request)))
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2976
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2938
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 3087
at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
in /home/johnny/Development/symfonyProject/app/bootstrap.php.cache line 2337
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
in /home/johnny/Development/symfonyProject/web/app_dev.php line 18
Try the tip at the end of this section:
https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/index.md#doctrine-orm-classes
It seems someone had the same problem and solved it, just read the comments below the article which is:
"If you don't have auto_mapping activated in your doctrine configuration you need to add FOSOAuthServerBundle to your mappings in config.yml."
Related
I have a PrestaShop 1.7.5 and have upgraded recently PayPal to version 5.4.0
seems the update has broken the payments
the PayPal pop up is displaying and then I get the error message
Error code: 0;Short message: The value of a field does not conform to the expected format.;
I have found this topic
https://www.prestashop.com/forums/topic/1038873-issues-with-paypal-v531/?do=findComment&comment=3292187
but after changing the rouding numbers form 3 to 2 I get agin an error from PayPal
Error code: 0;Short message: The value of a field is either too short or too long.;
can anyone help?
(1/1) ContextErrorException
Notice: Trying to get property 'id' of non-object
in custompopup.php line 386
at CustomPopup->functionHook(array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))in custompopup.php line 83
at CustomPopup->__call('hookdisplayFooter', array(array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2)))in Hook.php line 966
at HookCore::coreCallHook(object(CustomPopup), 'hookdisplayFooter', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))in Hook.php line 351
at HookCore::callHookOn(object(CustomPopup), 'displayFooter', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2))in Hook.php line 903
at HookCore::exec('displayFooter', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => 2), null)in smarty.config.inc.php line 165
at smartyHook(array('h' => 'displayFooter'), object(SmartyDevTemplate))in SmartyLazyRegister.php line 83
at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayFooter'), object(SmartyDevTemplate)))in 5debc5491c55490fb70872b4b8ac73e7c4b076d5_2.file.footer.tpl.php line 92
at Block_261192810604657b04b0269_01194600->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_261192810604657b04b0269_01194600), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_261192810604657b04b0269_01194600))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_261192810604657b04b0269_01194600', 'hook_footer')in 5debc5491c55490fb70872b4b8ac73e7c4b076d5_2.file.footer.tpl.php line 39
at content_604657b04b3ee8_66053338(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender('file:_partials/footer.tpl', null, 'layouts/layout-full-width.tpl', 0, 3600, array(), 0, false)in e8aae06b74c347ba1d8da54e2a9d5a9f73bac7c7_2.module.paypalviewstemplatesfront.php line 163
at Block_1467223895604657b03129d9_88778906->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_1467223895604657b03129d9_88778906), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_1467223895604657b03129d9_88778906))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), 'Block_1467223895604657b03129d9_88778906', 'footer')in e8aae06b74c347ba1d8da54e2a9d5a9f73bac7c7_2.module.paypalviewstemplatesfront.php line 99
at content_604657b0314b23_85855752(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, 'layouts/layout-full-width.tpl', null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch('module:paypal/views/templates/front/payment_error.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false)in SmartyDev.php line 40
at SmartyDev->fetch('module:paypal/views/templates/front/payment_error.tpl', null, 'layouts/layout-full-width.tpl')in FrontController.php line 682
at FrontControllerCore->smartyOutputContent('module:paypal/views/templates/front/payment_error.tpl')in FrontController.php line 666
at FrontControllerCore->display()in Controller.php line 301
at ControllerCore->run()in Dispatcher.php line 509
at DispatcherCore->dispatch()in index.php line 28
I have installed OroCommerce, a Symfony2 based application. I want to have the 'vendor' directory on a higher level outside the users directory. I followed the steps at http://symfony.com/doc/current/configuration/override_dir_structure.html#override-the-vendor-directory but now the namespaces can't be found. I get the following error:
InvalidArgumentException in YamlFileLoader.php line 399: There is no extension able to load the configuration for "framework" (in /home/oro2/public_html/app/config/config_dev.yml). Looked for namespace "framework", found "web_profiler", "sensio_distribution", "debug"
in YamlFileLoader.php line 399
at YamlFileLoader->validate(array('imports' => array(array('resource' => 'config.yml')), 'framework' => array('router' => array('resource' => '%kernel.root_dir%/config/routing_dev.yml'), 'profiler' => array('only_exceptions' => false)), 'web_profiler' => array('toolbar' => true, 'intercept_redirects' => false), 'monolog' => array('handlers' => array('main' => array('type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'))), 'oro_assetic' => array('css_debug' => null, 'css_debug_all' => false), 'oro_message_queue' => array('client' => array('traceable_producer' => true))), '/home/oro2/public_html/app/config/config_dev.yml') in YamlFileLoader.php line 369
at YamlFileLoader->loadFile('/home/oro2/public_html/app/config/config_dev.yml') in YamlFileLoader.php line 44
at YamlFileLoader->load('/home/oro2/public_html/app/config/config_dev.yml', null) in DelegatingLoader.php line 45
at DelegatingLoader->load('/home/oro2/public_html/app/config/config_dev.yml') in AppKernel.php line 35
at AppKernel->registerContainerConfiguration(object(DelegatingLoader)) in bootstrap.php.cache line 2776
at Kernel->buildContainer() in bootstrap.php.cache line 2728
at Kernel->initializeContainer() in OroKernel.php line 290
at OroKernel->initializeContainer() in bootstrap.php.cache line 2507
at Kernel->boot() in OroKernel.php line 252
at OroKernel->boot() in bootstrap.php.cache line 2538
at Kernel->handle(object(Request)) in app_dev.php line 33
Am I forgetting something? Does anyone know how to solve this problem?
You are somewhere calling %kernel.root_dir%/config/routing_dev.yml which actually does not exist, because you have moved the config file dir
I remember after composer updating I got this error, but previously it worked perfectly, and in comparing the packages versions I didn't find differences. I used it in this way in template:
{{ include(template_from_string(page.body)) }}
where "page" is entity object from controller. Current versions are:
symfony/symfony v2.8.15
twig/extensions v1.4.1
twig/twig v1.30.0
Also in config.yml:
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form_themes:
- 'AppBundle::Form/form_override.html.twig'
Now there is in vendor/twig/twig/lib/twig/Twig/Extension/StringLoader.php visually correct file, but seems it still not working. Full stacktrace:
[1] Twig_Error_Syntax: Unknown "template_from_string" function.
at n/a
in ProjectDir\src\AppBundle/Resources/views/Page.html.twig line 22
at Twig_ExpressionParser->getFunctionNodeClass('template_from_string', '22')
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 374
at Twig_ExpressionParser->getFunctionNode('template_from_string', '22')
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 162
at Twig_ExpressionParser->parsePrimaryExpression()
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 102
at Twig_ExpressionParser->getPrimary()
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 55
at Twig_ExpressionParser->parseExpression()
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 520
at Twig_ExpressionParser->parseArguments(true)
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 373
at Twig_ExpressionParser->getFunctionNode('include', '22')
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 162
at Twig_ExpressionParser->parsePrimaryExpression()
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 102
at Twig_ExpressionParser->getPrimary()
in ProjectDir\vendor\twig\twig\lib\Twig\ExpressionParser.php line 55
at Twig_ExpressionParser->parseExpression()
in ProjectDir\vendor\twig\twig\lib\Twig\Parser.php line 147
at Twig_Parser->subparse(array(object(Twig_TokenParser_Block), 'decideBlockEnd'), true)
in ProjectDir\vendor\twig\twig\lib\Twig\TokenParser\Block.php line 40
at Twig_TokenParser_Block->parse(object(Twig_Token))
in ProjectDir\vendor\twig\twig\lib\Twig\Parser.php line 190
at Twig_Parser->subparse(null, false)
in ProjectDir\vendor\twig\twig\lib\Twig\Parser.php line 103
at Twig_Parser->parse(object(Twig_TokenStream))
in ProjectDir\app\cache\dev\classes.php line 3415
at Twig_Environment->parse(object(Twig_TokenStream))
in ProjectDir\app\cache\dev\classes.php line 3443
at Twig_Environment->compileSource(object(Twig_Source))
in ProjectDir\app\cache\dev\classes.php line 3291
at Twig_Environment->loadTemplate('AppBundle::Page.html.twig')
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bridge\Twig\TwigEngine.php line 126
at Symfony\Bridge\Twig\TwigEngine->load('AppBundle::Page.html.twig')
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bridge\Twig\TwigEngine.php line 50
at Symfony\Bridge\Twig\TwigEngine->render('AppBundle::Page.html.twig', array('page' => object(Page), 'ads' => array(object(VertBanner), object(VertBanner)), 'slug' => 'direktor'))
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 72
at Symfony\Bundle\TwigBundle\TwigEngine->render('AppBundle::Page.html.twig', array('page' => object(Page), 'ads' => array(object(VertBanner), object(VertBanner)), 'slug' => 'direktor'))
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bundle\TwigBundle\TwigEngine.php line 103
at Symfony\Bundle\TwigBundle\TwigEngine->renderResponse('AppBundle::Page.html.twig', array('page' => object(Page), 'ads' => array(object(VertBanner), object(VertBanner)), 'slug' => 'direktor'), null)
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Controller\Controller.php line 185
at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('AppBundle::Page.html.twig', array('page' => object(Page), 'ads' => array(object(VertBanner), object(VertBanner)), 'slug' => 'direktor'))
in ProjectDir\src\AppBundle\Controller\PageController.php line 35
at AppBundle\Controller\PageController->getPageAction('direktor')
in line
at call_user_func_array(array(object(PageController), 'getPageAction'), array('direktor'))
in ProjectDir\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php line 144
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
in ProjectDir\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php line 64
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
in ProjectDir\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel.php line 69
at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
in ProjectDir\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php line 185
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
in ProjectDir\web\app_dev.php line 28
at require('ProjectDir\web\app_dev.php')
in ProjectDir\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Resources\config\router_dev.php line 40
You must let the Service Container know about your Twig Extension:
# app/config/services.yml
acme.twig.extension.loader:
class: Twig_Extension_StringLoader
tags:
- { name: 'twig.extension' }
Symfony 4:
# config/services.yml
app.twig.extension.loader:
class: Twig\Extension\StringLoaderExtension
tags:
- { name: 'twig.extension' }
For symfony5 and twig3, the answer from here worked: Symfony 4: Add Twig_Extension_StringLoader
# config/services.yaml
services:
Twig\Extension\StringLoaderExtension:
As this is more easily findable in google, I'll add it here.
im working in SmFony Project but i got some issues when i would get access on my poject via this URL : http://localhost/oksa-depannage/web/app_dev.php/login
"OKSA-DEPANNAGE" is a project name.
So i hope that my question is clear
Errors :
in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 106
at ParameterBag->get('java_path') in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 232
at ParameterBag->resolveString('%java_path%', array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 203
at ParameterBag->resolveValue('%java_path%', array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 193
at ParameterBag->resolveValue(array('debug' => '%kernel.debug%', 'use_controller' => false, 'bundles' => array('OksaTemplateBundle'), 'java' => '%java_path%', 'filters' => array('cssrewrite' => null, 'yui_css' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'), 'yui_js' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'))), array()) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.php line 193
at ParameterBag->resolveValue(array(array('debug' => '%kernel.debug%', 'use_controller' => false, 'bundles' => array('OksaTemplateBundle'), 'java' => '%java_path%', 'filters' => array('cssrewrite' => null, 'yui_css' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'), 'yui_js' => array('jar' => '%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar'))), array('use_controller' => true))) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass.php line 44
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php line 117
at Compiler->compile(object(ContainerBuilder)) in C:\wamp\www\oksa-depannage\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php line 619
at ContainerBuilder->compile() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2491
at Kernel->initializeContainer() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2270
at Kernel->boot() in C:\wamp\www\oksa-depannage\app\bootstrap.php.cache line 2301
at Kernel->handle(object(Request)) in C:\wamp\www\oksa-depannage\web\app_dev.php line 28
thanks for your helps.
Looks like symfony is trying to start the yui compressor, which is a java library.
This post has a workaround to make this situation work on windows: symfony2 assetics yui compressor on windows (path syntax)
When am adding an extension (EfontAwesome, ref: www.yiiframework.com/extension/efontawesome) to Yii I am getting "chmod(): operation not permitted"
The Call Stack looked something like this..
/opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133)
121 while(($file=readdir($folder))!==false)
122 {
123 if($file==='.' || $file==='..')
124 continue;
125 $path=$src.DIRECTORY_SEPARATOR.$file;
126 $isFile=is_file($path);
127 if(self::validatePath($base,$file,$isFile,$fileTypes,$exclude))
128 {
129 if($isFile)
130 {
131 copy($path,$dst.DIRECTORY_SEPARATOR.$file);
132 if(isset($options['newFileMode']))
133 chmod($dst.DIRECTORY_SEPARATOR.$file,$options['newFileMode']);
134 }
135 elseif($level)
136 self::copyDirectoryRecursive($path,$dst.DIRECTORY_SEPARATOR.$file,$base.'/'.$file,$fileTypes,$exclude,$level-1,$options);
137 }
138 }
139 closedir($folder);
140 }
141
142 /**
143 * Returns the files found under the specified directory and subdirectories.
144 * This method is mainly used by {#link findFiles}.
145 * #param string $dir the source directory
Stack Trace
#0
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(133): chmod("/opt/lampp/htdocs/im/assets/6950b6ca/css/font-awesome.css", 438)
#1
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(136): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets/cs...", "/opt/lampp/htdocs/im/assets/6950b6ca/css", "/css", array(), ...)
#2
+ /opt/lampp/htdocs/yii-1.1.13/framework/utils/CFileHelper.php(63): CFileHelper::copyDirectoryRecursive("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", "", array(), ...)
#3
+ /opt/lampp/htdocs/yii-1.1.13/framework/web/CAssetManager.php(251): CFileHelper::copyDirectory("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", "/opt/lampp/htdocs/im/assets/6950b6ca", array("exclude" => array(".svn", ".gitignore"), "level" => -1, "newDirMode" => 511, "newFileMode" => 438))
#4
– /opt/lampp/htdocs/im/protected/extensions/EFontAwesome/components/EFontAwesome.php(41): CAssetManager->publish("/opt/lampp/htdocs/im/protected/extensions/EFontAwesome/assets", false, -1, true)
36 public function getAssetsUrl() {
37 if (isset($this->_assetsUrl))
38 return $this->_assetsUrl;
39 else {
40 $assetsPath = Yii::getPathOfAlias('efontawesome.assets');
41 $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG);
42 return $this->_assetsUrl = $assetsUrl;
43 }
44 }
45 }
This is only happening in debug mode and not in production mode.
The directory is writable by the web process (as it can be seen to work in production mode) and this extension was working perfectly well in debug mode few days back,
A brief google search only bought up the this closed issue on github :https://github.com/yiisoft/yii/issues/1853 regarding forcedCopy and linkAssets config conflict, which was fixed in Yii-1.1.13(the version I am using), just to be safe I had also tried setting the config of both to false in the main config files like this
'assetManager' => array(
'linkAssets' => false,
'forceCopy'=>false,
),
but the issue is persisting, any ideas on how to solve this?