Error on Swagger after API Platform update - php

I updated API Platform from 1.2 to 2.7 on an old project.
My API work fine, but I've an error on the Swagger HTML page :
TypeError:
Lexik\Bundle\JWTAuthenticationBundle\OpenApi\OpenApiFactory::__construct(): Argument #2 ($checkPath) must be of type string, null given, called in /app/var/cache/dev/ContainerCRp5KBI/getLexikJwtAuthentication_ApiPlatform_Openapi_FactoryService.php on line 14
at vendor/lexik/jwt-authentication-bundle/OpenApi/OpenApiFactory.php:31
at Lexik\Bundle\JWTAuthenticationBundle\OpenApi\OpenApiFactory->__construct(object(OpenApiFactory), null, null, null)
(var/cache/dev/ContainerCRp5KBI/getLexikJwtAuthentication_ApiPlatform_Openapi_FactoryService.php:14)
at require('/app/var/cache/dev/ContainerCRp5KBI/getLexikJwtAuthentication_ApiPlatform_Openapi_FactoryService.php')
(var/cache/dev/ContainerCRp5KBI/srcApp_KernelDevDebugContainer.php:682)
at ContainerCRp5KBI\srcApp_KernelDevDebugContainer->load('getLexikJwtAuthentication_ApiPlatform_Openapi_FactoryService.php')
(var/cache/dev/ContainerCRp5KBI/getApiPlatform_SwaggerUi_ActionService.php:12)
at require('/app/var/cache/dev/ContainerCRp5KBI/getApiPlatform_SwaggerUi_ActionService.php')
(var/cache/dev/ContainerCRp5KBI/srcApp_KernelDevDebugContainer.php:682)
at ContainerCRp5KBI\srcApp_KernelDevDebugContainer->load('getApiPlatform_SwaggerUi_ActionService.php')
(var/cache/dev/ContainerCRp5KBI/getApiPlatform_Swagger_Action_UiService.php:11)
at require('/app/var/cache/dev/ContainerCRp5KBI/getApiPlatform_Swagger_Action_UiService.php')
(var/cache/dev/ContainerCRp5KBI/srcApp_KernelDevDebugContainer.php:682)
at ContainerCRp5KBI\srcApp_KernelDevDebugContainer->load('getApiPlatform_Swagger_Action_UiService.php')
(vendor/symfony/dependency-injection/Container.php:255)
at Symfony\Component\DependencyInjection\Container->make('api_platform.swagger.action.ui', 1)
(vendor/symfony/dependency-injection/Container.php:231)
at Symfony\Component\DependencyInjection\Container->get('api_platform.swagger.action.ui')
(vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:53)
at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController('api_platform.swagger.action.ui')
(vendor/symfony/framework-bundle/Controller/ControllerResolver.php:70)
at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController('api_platform.swagger.action.ui')
(vendor/symfony/http-kernel/Controller/ControllerResolver.php:110)
at Symfony\Component\HttpKernel\Controller\ControllerResolver->createController('api_platform.swagger.action.ui')
(vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:42)
at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->createController('api_platform.swagger.action.ui')
(vendor/symfony/framework-bundle/Controller/ControllerResolver.php:62)
at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->createController('api_platform.swagger.action.ui')
(vendor/symfony/http-kernel/Controller/ControllerResolver.php:86)
at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController(object(Request))
(vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:38)
at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController(object(Request))
(vendor/symfony/http-kernel/HttpKernel.php:152)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:81)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:201)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:25)
Why I call the entrypoint as a JSON format, everything work fine. So I don't understand where this error comes from ?

Related

cPanel Account Login - WHMCS

Up to version 8.4.1 I was able to use this code in the hook folder.
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
$service = Menu::context('service');
$domain = $service->domain;
$servertype = $service->product->servertype;
# Not cPanel, no links added
if ($servertype!="cpanel"){
return;
}
if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
$primarySidebar->getChild('Service Details Actions')
->getChild('Login to cPanel')
->setUri('http://'.$domain.'/cpanel');
$primarySidebar->getChild('Service Details Actions')
->getChild('Login to Webmail')
->setUri('http://'.$domain.'/webmail');
}
});
In version 8.5.1 it stopped working.
say this message:
Error: Call to a member function setUri() on null in
/home/.../.../includes/hooks/cpanel_login.php:20 Stack trace:
#0 /home/..../..../vendor/whmcs/whmcs-foundation/lib/Hook/Manager.php(0):
WHMCS\Utility\SafeInclude::{closure}(Object(WHMCS\View\Menu\Item))
#1 /home/..../..../vendor/illuminate/support/Facades/Facade.php(261): WHMCS\Hook\Manager->run('ClientAreaPrima...', Array, true)
#2 /home/..../..../includes/functions.php(0): Illuminate\Support\Facades\Facade::__callStatic('run', Array)
#3 /home/..../..../vendor/whmcs/whmcs-foundation/lib/ClientArea.php(0):
run_hook('ClientAreaPrima...', Array, true)
#4 /home/..../..../vendor/whmcs/whmcs-foundation/lib/ClientArea.php(0):
WHMCS\ClientArea->outputWithoutExit()
#5 /home/..../..../vendor/whmcs/whmcs-foundation/lib/Http/Message/AbstractViewableResponse.php(0):
WHMCS\ClientArea->getOutputContent()
#6 /home/..../..../vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(41):
WHMCS\Http\Message\AbstractViewableResponse->getBody()
#7 /home/..../..../vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(31):
Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emitBody(Object(WHMCS\ClientArea))
#8 /home/..../..../clientarea.php(0): Laminas\HttpHandlerRunner\Emitter\SapiEmitter->emit(Object(WHMCS\ClientArea))
#9 {main}
Does anyone know how to solve this issue?
You're trying to use setUri() on null.
You're only checking if there's a sidebar element called "Service Details Actions" - but if either "Service Details Actions", "Login to cPanel" or "Login to Webmail" doesn't exist, you're trying to set a uri for a sidebare child element that doesn't exist.
This most likely has something to do with WHMCS changing how menuitems worked in 8.4.1: https://docs.whmcs.com/Changelog:WHMCS_V8.4#Maintenance_4
CORE-17437 - Prevent declaration error related to Menu items
Also known as: CORE-17436
New names are "cpanel" and "webmail" instead of "Login to cPanel" and "Login to Webmail".
To avoid exceptions being thrown, you should check if the menuitem exists.

Fatal error when adding product to cart in PrestaShop

I wont add product to cart in prestashop 1.7 but When i execute code below, i return Fatal error but in other card in browser i refresh cart and have the product, attribute and quantity what adding in code. So whats the problem with code, work well but return fatal error
require_once('config/config.inc.php');
require_once('classes/Cart.php');
function addProductToCart($id, $productAttributeID)
{
$context = Context::getContext();
$id_cart = $context->cookie->__get('id_cart');
$cart = new Cart($id_cart);
$cart->updateQty(1, (int)$id, (int)$productAttributeID);
$cart->update();
Tools::redirect('order');
}
addProductToCart(41, 518);
Fatal error: Uncaught PrestaShopException: Błąd krytyczny in
/home/symon/php/39/pet-food-shop/classes/Tools.php:1109 Stack trace:
0 /home/symon/php/39/pet-food-shop/classes/Product.php(3153): ToolsCore::displayError() #1
/home/symon/php/39/pet-food-shop/classes/Product.php(4741):
ProductCore::getPriceStatic(41, false, 518, 6, NULL, false, true, 1)
2 /home/symon/php/39/pet-food-shop/classes/Cart.php(811): ProductCore::getProductProperties(1, Array) #3
/home/symon/php/39/pet-food-shop/classes/Cart.php(1456):
CartCore->getProducts(true) #4
/home/symon/php/39/pet-food-shop/addProductToCart.php(17):
CartCore->updateQty(1, 41, 518) #5
/home/symon/php/39/pet-food-shop/addProductToCart.php(34):
addProductToCart(41, 518) #6 {main} thrown in
/home/symon/php/39/pet-food-shop/classes/Tools.php on line 1109
Your script is not a part of prestashop (module or override), so prestashop context does not work properly. You should include init.php also.
Then prestashop context works with frontend context, then product price works fine.
<?php
require_once 'config/config.inc.php';
require_once 'init.php';

Laravel 5.5 using artesaos/defender

i'm using laravel 5.5.* and install this https://github.com/artesaos/defender package for roles and permission, all things working fine but when i try to get permission
$permissions = array_map(function ($permission) {
return $permission['name'];
}, $user->getAllPermissions()->toArray());
getting blow error:
"Symfony\Component\Debug\Exception\FatalThrowableError" file : H:\xampp\htdocs\LaraVueAdmin\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php"
line: 147 message : "Type error: Argument 1 passed to Illuminate\Database\Eloquent\Model::__construct() must be of the type array, object given, called in H:\xampp\htdocs\LaraVueAdmin\vendor\artesaos\defender\src\Defender\Traits\Models\Permission.php on line 75"
This solution of Muzafar Ali, worked for me:
I found out the solution by replacing github.com/artesaos/defender/blob/master/src/Defender/Traits/…
with
return PermissionUserPivot::fromRawAttributes($parent, $attributes,
$table, $exists, $using);

deprecated warnings when using sonata admin bundle

I am using symfony2.7 with sonata admin doctrine orm bundle, I followed the official install instructions, works fine except one thing. At every request I get the following debrecated warnings, and I dont know how to eliminate it.
Date: 2016-10-18 08:58:28
Fatal: array(
['type'] => 16384,
['message'] => 'This class is deprecated since 3.2 and will be removed with the 4.0 release.Use Sonata\BlockBundle\Block\Block\Service\AbstractBlockService instead.',
['file'] => '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev/classes.php',
['line'] => 8575,
)
edit: I attached a stack trace
1 in classes.php line 9354
2 at require_once() in ClassCollectionLoader.php line 96
3 at ClassCollectionLoader::load(array('Symfony\Bundle\FrameworkBundle\EventListener\SessionListener', 'Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage', 'Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage', 'Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler', 'Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy', 'Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', 'Symfony\Component\HttpFoundation\Session\Session', 'Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables', 'Symfony\Bundle\FrameworkBundle\Templating\TemplateReference', 'Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser', 'Symfony\Bundle\FrameworkBundle\Templating\Loader\TemplateLocator', 'Symfony\Component\Routing\Generator\UrlGenerator', 'Symfony\Component\Routing\RequestContext', 'Symfony\Component\Routing\Router', 'Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher', 'Symfony\Bundle\FrameworkBundle\Routing\Router', 'Symfony\Component\Config\FileLocator', 'Symfony\Component\Debug\ErrorHandler', 'Symfony\Component\EventDispatcher\Event', 'Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher', 'Symfony\Component\HttpKernel\EventListener\ResponseListener', 'Symfony\Component\HttpKernel\EventListener\RouterListener', 'Symfony\Component\HttpKernel\Controller\ControllerResolver', 'Symfony\Component\HttpKernel\Event\KernelEvent', 'Symfony\Component\HttpKernel\Event\FilterControllerEvent', 'Symfony\Component\HttpKernel\Event\FilterResponseEvent', 'Symfony\Component\HttpKernel\Event\GetResponseEvent', 'Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent', 'Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent', 'Symfony\Component\HttpKernel\KernelEvents', 'Symfony\Component\HttpKernel\Config\FileLocator', 'Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser', 'Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver', 'Symfony\Component\Security\Http\AccessMap', 'Symfony\Component\Security\Http\Firewall', 'Symfony\Component\Security\Core\User\UserProviderInterface', 'Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager', 'Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage', 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager', 'Symfony\Component\Security\Core\Authorization\AuthorizationChecker', 'Symfony\Component\Security\Core\Authorization\Voter\VoterInterface', 'Symfony\Bundle\SecurityBundle\Security\FirewallMap', 'Symfony\Bundle\SecurityBundle\Security\FirewallContext', 'Symfony\Component\HttpFoundation\RequestMatcher', 'Twig_Environment', 'Twig_Extension', 'Twig_Extension_Core', 'Twig_Extension_Escaper', 'Twig_Extension_Optimizer', 'Twig_LoaderInterface', 'Twig_Markup', 'Twig_Template', 'Monolog\Formatter\FormatterInterface', 'Monolog\Formatter\LineFormatter', 'Monolog\Handler\HandlerInterface', 'Monolog\Handler\AbstractHandler', 'Monolog\Handler\AbstractProcessingHandler', 'Monolog\Handler\StreamHandler', 'Monolog\Handler\FingersCrossedHandler', 'Monolog\Handler\FilterHandler', 'Monolog\Handler\TestHandler', 'Monolog\Logger', 'Symfony\Bridge\Monolog\Logger', 'Symfony\Bridge\Monolog\Handler\DebugHandler', 'Monolog\Handler\FingersCrossed\ActivationStrategyInterface', 'Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy', 'Symfony\Bundle\AsseticBundle\DefaultValueSupplier', 'Symfony\Bundle\AsseticBundle\Factory\AssetFactory', 'Doctrine\Common\Annotations\DocLexer', 'Doctrine\Common\Annotations\FileCacheReader', 'Doctrine\Common\Annotations\PhpParser', 'Doctrine\Common\Annotations\Reader', 'Doctrine\Common\Lexer', 'Doctrine\Common\Persistence\ConnectionRegistry', 'Doctrine\Common\Persistence\Proxy', 'Doctrine\Common\Util\ClassUtils', 'Doctrine\Bundle\DoctrineBundle\Registry', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface', 'Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterManager', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener', 'Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener', 'Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationAnnotation', 'Sonata\CoreBundle\Form\Type\BooleanType', 'Sonata\CoreBundle\Form\Type\CollectionType', 'Sonata\CoreBundle\Form\Type\DateRangeType', 'Sonata\CoreBundle\Form\Type\DateTimeRangeType', 'Sonata\CoreBundle\Form\Type\EqualType', 'Sonata\CoreBundle\Form\Type\ImmutableArrayType', 'Sonata\CoreBundle\Form\Type\TranslatableChoiceType', 'Sonata\BlockBundle\Block\BaseBlockService', 'Sonata\BlockBundle\Block\BlockLoaderChain', 'Sonata\BlockBundle\Block\BlockLoaderInterface', 'Sonata\BlockBundle\Block\BlockRenderer', 'Sonata\BlockBundle\Block\BlockRendererInterface', 'Sonata\BlockBundle\Block\BlockServiceInterface', 'Sonata\BlockBundle\Block\BlockServiceManager', 'Sonata\BlockBundle\Block\BlockServiceManagerInterface', 'Sonata\BlockBundle\Block\Loader\ServiceLoader', 'Sonata\BlockBundle\Block\Service\EmptyBlockService', 'Sonata\BlockBundle\Block\Service\RssBlockService', 'Sonata\BlockBundle\Block\Service\MenuBlockService', 'Sonata\BlockBundle\Block\Service\TextBlockService', 'Sonata\BlockBundle\Exception\BlockExceptionInterface', 'Sonata\BlockBundle\Exception\BlockNotFoundException', 'Sonata\BlockBundle\Exception\Filter\DebugOnlyFilter', 'Sonata\BlockBundle\Exception\Filter\FilterInterface', 'Sonata\BlockBundle\Exception\Filter\IgnoreClassFilter', 'Sonata\BlockBundle\Exception\Filter\KeepAllFilter', 'Sonata\BlockBundle\Exception\Filter\KeepNoneFilter', 'Sonata\BlockBundle\Exception\Renderer\InlineDebugRenderer', 'Sonata\BlockBundle\Exception\Renderer\InlineRenderer', 'Sonata\BlockBundle\Exception\Renderer\MonkeyThrowRenderer', 'Sonata\BlockBundle\Exception\Renderer\RendererInterface', 'Sonata\BlockBundle\Exception\Strategy\StrategyManager', 'Sonata\BlockBundle\Exception\Strategy\StrategyManagerInterface', 'Sonata\BlockBundle\Form\Type\ServiceListType', 'Sonata\BlockBundle\Model\BaseBlock', 'Sonata\BlockBundle\Model\Block', 'Sonata\BlockBundle\Model\BlockInterface', 'Sonata\BlockBundle\Model\BlockManagerInterface', 'Sonata\BlockBundle\Model\EmptyBlock', 'Sonata\BlockBundle\Twig\Extension\BlockExtension', 'Sonata\BlockBundle\Twig\GlobalVariables', 'Sonata\AdminBundle\Admin\AbstractAdmin', 'Sonata\AdminBundle\Admin\AbstractAdminExtension', 'Sonata\AdminBundle\Admin\AdminExtensionInterface', 'Sonata\AdminBundle\Admin\AdminHelper', 'Sonata\AdminBundle\Admin\AdminInterface', 'Sonata\AdminBundle\Admin\BaseFieldDescription', 'Sonata\AdminBundle\Admin\FieldDescriptionCollection', 'Sonata\AdminBundle\Admin\FieldDescriptionInterface', 'Sonata\AdminBundle\Admin\Pool', 'Sonata\AdminBundle\Block\AdminListBlockService', 'Sonata\AdminBundle\Builder\DatagridBuilderInterface', 'Sonata\AdminBundle\Builder\FormContractorInterface', 'Sonata\AdminBundle\Builder\ListBuilderInterface', 'Sonata\AdminBundle\Builder\RouteBuilderInterface', 'Sonata\AdminBundle\Builder\ShowBuilderInterface', 'Sonata\AdminBundle\Datagrid\Datagrid', 'Sonata\AdminBundle\Datagrid\DatagridInterface', 'Sonata\AdminBundle\Datagrid\DatagridMapper', 'Sonata\AdminBundle\Datagrid\ListMapper', 'Sonata\AdminBundle\Datagrid\Pager', 'Sonata\AdminBundle\Datagrid\PagerInterface', 'Sonata\AdminBundle\Datagrid\ProxyQueryInterface', 'Sonata\AdminBundle\Exception\ModelManagerException', 'Sonata\AdminBundle\Exception\NoValueException', 'Sonata\AdminBundle\Filter\Filter', 'Sonata\AdminBundle\Filter\FilterFactory', 'Sonata\AdminBundle\Filter\FilterFactoryInterface', 'Sonata\AdminBundle\Filter\FilterInterface', 'Sonata\AdminBundle\Form\DataTransformer\ArrayToModelTransformer', 'Sonata\AdminBundle\Form\DataTransformer\ModelsToArrayTransformer', 'Sonata\AdminBundle\Form\DataTransformer\ModelToIdTransformer', 'Sonata\AdminBundle\Form\EventListener\MergeCollectionListener', 'Sonata\AdminBundle\Form\Extension\Field\Type\FormTypeFieldExtension', 'Sonata\AdminBundle\Form\FormMapper', 'Sonata\AdminBundle\Form\Type\AdminType', 'Sonata\AdminBundle\Form\Type\Filter\ChoiceType', 'Sonata\AdminBundle\Form\Type\Filter\DateRangeType', 'Sonata\AdminBundle\Form\Type\Filter\DateTimeRangeType', 'Sonata\AdminBundle\Form\Type\Filter\DateTimeType', 'Sonata\AdminBundle\Form\Type\Filter\DateType', 'Sonata\AdminBundle\Form\Type\Filter\DefaultType', 'Sonata\AdminBundle\Form\Type\Filter\NumberType', 'Sonata\AdminBundle\Form\Type\ModelReferenceType', 'Sonata\AdminBundle\Form\Type\ModelType', 'Sonata\AdminBundle\Form\Type\ModelListType', 'Sonata\AdminBundle\Guesser\TypeGuesserChain', 'Sonata\AdminBundle\Guesser\TypeGuesserInterface', 'Sonata\AdminBundle\Model\AuditManager', 'Sonata\AdminBundle\Model\AuditManagerInterface', 'Sonata\AdminBundle\Model\AuditReaderInterface', 'Sonata\AdminBundle\Model\ModelManagerInterface', 'Sonata\AdminBundle\Route\AdminPoolLoader', 'Sonata\AdminBundle\Route\DefaultRouteGenerator', 'Sonata\AdminBundle\Route\PathInfoBuilder', 'Sonata\AdminBundle\Route\QueryStringBuilder', 'Sonata\AdminBundle\Route\RouteCollection', 'Sonata\AdminBundle\Route\RouteGeneratorInterface', 'Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap', 'Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder', 'Sonata\AdminBundle\Security\Handler\AclSecurityHandler', 'Sonata\AdminBundle\Security\Handler\AclSecurityHandlerInterface', 'Sonata\AdminBundle\Security\Handler\NoopSecurityHandler', 'Sonata\AdminBundle\Security\Handler\RoleSecurityHandler', 'Sonata\AdminBundle\Security\Handler\SecurityHandlerInterface', 'Sonata\AdminBundle\Show\ShowMapper', 'Sonata\AdminBundle\Translator\BCLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\FormLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\LabelTranslatorStrategyInterface', 'Sonata\AdminBundle\Translator\NativeLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\NoopLabelTranslatorStrategy', 'Sonata\AdminBundle\Translator\UnderscoreLabelTranslatorStrategy', 'Sonata\AdminBundle\Twig\Extension\SonataAdminExtension', 'Sonata\AdminBundle\Util\AdminAclManipulator', 'Sonata\AdminBundle\Util\AdminAclManipulatorInterface', 'Sonata\AdminBundle\Util\FormBuilderIterator', 'Sonata\AdminBundle\Util\FormViewIterator', 'Sonata\AdminBundle\Util\ObjectAclManipulator', 'Sonata\AdminBundle\Util\ObjectAclManipulatorInterface'), '/www/managedoc/branch/hoffereka/app/cache/superadmin_dev', 'classes', true, false, '.php') in bootstrap.php.cache line 2609
4 at Kernel->doLoadClassCache('classes', '.php') in bootstrap.php.cache line 2444
5 at Kernel->boot() in bootstrap.php.cache line 2478
6 at Kernel->handle(object(Request)) in app_dev.php line 34
7 at require_once('/www/managedoc/branch/hoffereka/web/app_dev.php') in app_superadmin_dev.php line 3
What happens is not necessarily your fault. As you can see here, the problem comes from a deprecation in the block bundle. Maybe the admin bundle (or some other bundle) is using it for some purpose and hasn't yet followed the deprecation recommendation.
Let's first fix the errors in the deprecation messages and make them more precise.
Digging more, you can see that 3.9.0 is supposed to fix this problem.
Can you run composer info to show us what version of the admin bundle you use?

Google+ API CommentActivity return 400 Error

I'm having no luck calling the Google+ API for pushing a CommentActivity moment.
I have been able to push an AddActivity successfully as well as a DiscoverActivity.
I read somewhere on the internet whilst searching for a solution that the 400 HTTP Status represents that my user credentials are invalid, but I have been able to post AddActivity & DiscoverActivity after trying CommentActivity and I have tried disconnecting and reconnecting my account and linking the required credentials to no avail.
Here's my code to generate the moment, I believe this is the error, and it's probably something to do with the use of a Target and a Result in this moment type (Neither DiscoverActivity nor AddActivity have a Result field). In particular, the Target's and Result's URLs are the same but the Result's has an appended anchor. The documentation implies that this should work fine, however.
$moment = new Google_Moment();
$moment->setType("http://schemas.google.com/CommentActivity");
$target = new Google_ItemScope();
$target->setUrl(get_permalink($comment->comment_post_id));
$target->setType("http://schema.org/Article");
$moment->setTarget($target);
$result = new Google_ItemScope();
$result->setId("comment-".$comment_id);
$result->setType("http://schema.org/Comment");
$result->setUrl(get_comment_link($comment_id));
$result->setText($comment->comment_content);
$moment->setResult($result);
Soci_Base::getSocial("google")->getUser($user)->GPlus->moments->insert('me', 'vault', $moment);
GPlus is a reference to a Google_PlusService object.
Here's my exception I receive with stack trace (Pointless parts of the files are omitted, hooks.php and plugin.php are not the Google+ API)
Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling POST https://www.googleapis.com/plus/v1/people/me/moments/vault?key=AIzaSyBa27u5PtBgFHO4SY_Fq9_0sO39pFWrRzE: (400) Invalid Value' in /~/src/io/Google_REST.php:66 Stack trace:
#0 /~/G+/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 /~/G+/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))
#2 /~/G+/src/contrib/Google_PlusService.php(167): Google_ServiceResource->__call('insert', Array)
#3 /~/hooks.php(54): Google_MomentsServiceResource->insert('me', 'vault', Object(Google_Moment))
#4 /~/plugin.php(406): soci_comment('108040')
#5 /~ in /~/lib/G+/src/io/Google_REST.php on line 66
I think that's all of the info I have on the matter - I have no idea to get the exact HTTP request the script makes.
Thank you in advance for any and all help and for even having a look ^_^
Here's the code for the whole login sequence:
Soci_Google::addActionRequirement('http://schemas.google.com/AddActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/CommentActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/CreateActivity');
Soci_Google::addActionRequirement('http://schemas.google.com/DiscoverActivity');
Soci_Google::addActionRequirement:
public static function addActionRequirement($url) {
self::$activities[] = $url;
}
self::$token is just a reference to a string
$ret = new Soci_Google();
self::$users[$id] = $ret;
$ret->setToken(self::$meta->getMeta($user, self::$token));
return $ret;
Soci_Google __construct():
public function __construct() {
$this->googleObj = new Google_Client();
$this->googleObj->setApplicationName(self::$appName);
$this->googleObj->setClientId(self::$clientID);
$this->googleObj->setClientSecret(self::$clientSecret);
$this->googleObj->setRedirectUri(self::$redirectURI);
$this->googleObj->setDeveloperKey(self::$devKey);
$this->GPlus = new Google_PlusService($this->googleObj);
$this->googleObj->setRequestVisibleActions(self::$activities);
}
Soci_Goolge setToken
$this->googleObj->setAccessToken($googleUsrToken);

Categories