Yes thank you for all your hard work. In my #24 I zeroed in on the PostAuth file you mention. My belief was to override it for body not headers. If the $params has anything more than the id and secret as shown in the USPS example it will fail - possibly without comment response.
The file that makes the API calls for USPS in my module uses Curl directly.
The original plan was to modify it to make the token calls, but to do token management would re-create what Oauth2Client already does.
I last worked on Oauth2 in Drupal 7 on a Stripe Connect flow project, and was I believe a character in the header which caused this same kind of isdue
I am going to try some mods to the override, then building the client_credentials Plugin with my working curl code.
Since Postman works, I know the problem is in the extra parameters being possibly included and still being sent possibly also in the header.
I will report back later.
My #24 example I said I likely called the client variables wrong. I did not look for an error in the code, I just do not see where it is put into or called into the body as a parameter. I where it is done in reverse sort of in https://www.drupal.org/project/oauth2_client/issues/3384244 💬 OptionProvidor overruled Closed: works as designed
USPS support responded to me with this
""Please see explanations below for the individual fields in OAuth.
• Scope: Only specified if you wish to have access to specific APIs. If omitted, all APIs configured to your App will be in scope.
• Code: This is a merchants authorization code that is provided to customers by third party platforms. In your case, this can be omitted.
• Redirect URI: This is the merchants URL to their platform. In your case, this can be omitted.
• Grant Type: This will be the type of token you are requesting. In your case, please use client_credentials""
So it is "scope" and not "scopes" but does not go into a client_credentials grant request regardless
The production api example runs but shows no delivery of a token nor error tp the log or php error log while the test api example does not show in the plugin list at all. The production example throws nothing to the log
Since Drupal uses Guzzle and Guzzle uses Curl - is it possible to build a plugin that make a curl call directly using the example from USPS??
Until I get an initial access token, no other grant can be sought.
That is what I last had in #24 calling by variable
Even using the actual text values it still throws
League\OAuth2\Client\Provider\Exception\IdentityProviderException: invalid_request in League\OAuth2\Client\Provider\GenericProvider->checkResponse() (line 236 of /public_html/vendor/league/oauth2-client/src/Provider/GenericProvider.php)
I believe it is continuing to send data in a header
Enabled logging and rotated logs manually to clear the junk.
Initially the plugin was missing a use statement for AbstractProvider
I added both
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\GenericProvider;
The plugin would enable and run then throwing (actually it enabled with only AbstractProvider)
League\OAuth2\Client\Provider\Exception\IdentityProviderException: invalid_request in League\OAuth2\Client\Provider\GenericProvider->checkResponse() (line 236 of /public_html/vendor/league/oauth2-client/src/Provider/GenericProvider.php)
with the following partial backtrace
#0 /public_html/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(740): League\OAuth2\Client\Provider\GenericProvider->checkResponse(Object(GuzzleHttp\Psr7\Response), Array)
#1 /public_html/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(646): League\OAuth2\Client\Provider\AbstractProvider->getParsedResponse(Object(GuzzleHttp\Psr7\Request))
#2 /public_html/modules/oauth2_client/src/Plugin/Oauth2GrantType/ClientCredentials.php(35): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken(Object(League\OAuth2\Client\Grant\ClientCredentials), Array)
#3 /public_html/modules/oauth2_client/src/Plugin/Oauth2Client/Oauth2ClientPluginBase.php(297): Drupal\oauth2_client\Plugin\Oauth2GrantType\ClientCredentials->getAccessToken(Object(Drupal\xxxxxxxxxxxxxxx\Plugin\Oauth2Client\Auth99Code))
#4 /public_html/modules/oauth2_client/src/Service/Oauth2ClientService.php(44): Drupal\oauth2_client\Plugin\Oauth2Client\Oauth2ClientPluginBase->getAccessToken(Object(Drupal\oauth2_client\OwnerCredentials))
#5 /public_html/modules/oauth2_client/src/Form/Oauth2ClientForm.php(330): Drupal\oauth2_client\Service\Oauth2ClientService->getAccessToken('auth99code', Object(Drupal\oauth2_client\OwnerCredentials))
#6 [internal function]: Drupal\oauth2_client\Form\Oauth2ClientForm->testToken(Array, Object(Drupal\Core\Form\FormState))
#7 /public_html/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array(Array, Array)
Looks like a Guzzle issue, but why is it trying to call "OwnerCredentials" ???
Thank you for this; however, it does not like
/**
* {@inheritdoc}
*/
public function getProvider(): AbstractProvider {
$provider = parent::getProvider();
$provider->setOptionProvider(new UspsClientCredentialsOptionProvider($this));
return $provider;
}
In firefox it is just a blank white screen and in Chrome it say the site cannot handle the request
Remove the code and the site will come up
The form is the default and this is the plugin which fails
<?php
declare(strict_types=1);
namespace Drupal\commerce_usps\Plugin\Oauth2Client;
use Drupal\oauth2_client\Plugin\Oauth2Client\Oauth2ClientPluginBase;
use Drupal\oauth2_client\Plugin\Oauth2Client\StateTokenStorage;
/**
* Auth code
*
* @Oauth2Client(
* id = "auth5code",
* name = @Translation("Auth5Code token grant"),
* grant_type = "client_credentials",
* authorization_uri = "https://apis.usps.com//oauth2/v3/token",
* token_uri = "https://apis.usps.com/oauth2/v3/token",
* success_message = TRUE
* )
*/
class Auth5Code extends Oauth2ClientPluginBase {
/*
* This example assumes that the Drupal site is using a shared resource
* from a third-party service that provides a service to all uses of the site.
*
* Storing a single AccessToken in state for the plugin shares access to the
* external resource for ALL users of this plugin.
*/
use StateTokenStorage;
}
I keep saying the client crendentials must be sent in the body - that is why it fails. They cannot be sent in the basic Authorization Header. My last stab at it above shows what I tried. Perhaps I called the client id and secret form variables wrong. But if sent in a header they will fail anyway - only are to be sent in the body
If this module does not send a GET then there is a bug because USPS replies with an error thrown to the browser on an attempt at an authorization_code grant saying it does because the GET is not allowed
A client credential fail throws no error - it just fails and hangs up on you no further info
See the attached Postman setup where "client crendentials sent in body" is selected and works
Client credentials flow is all I have ever been seeking to get to work right now
Early I posted the screen capture of the reject if a GET request is made on /token
You explained the issue here
"" I am describing the process for the authorization code flow and you are responding about the client credentials flow. This module will not send the client credentials token request, or any token request in a GET since I am not overriding the default in the upstream library.""
So it sounds like you are now saying client credentials does not in the library send a GET request
If it sends POST that is great, but it needs to be sent in the BODY not the HEADER
A Basic Header Authorization will not work. There is no initial log in, just the POST as a client credentials grant with client ID and secret as a POST in the BODY
I do not what you are talking about getting Oauth2 working with a reliable service. It already is working.
So does the client credentials flow send only a POST by default, if so then the modification is only to send the data params in the body and not the header like the last thing I asked about the $options
OK, tired of this or is there no solution??
I came across a similar issue with client_credentials - but that poster wanting to send for authorization in the headers and not in the body at https://www.drupal.org/project/oauth2_client/issues/3384244 💬 OptionProvidor overruled Closed: works as designed . You wrote a solution there.
I am studying how I might modify that. It looks like the
* optionProvider = "\League\OAuth2\Client\OptionProvider\PostAuthOptionProvider",
might be useful, unless I am reading it incorrectly
I then discovered the client id and secret could be called in the plugin itself - like somethng as for a plugin as
/**
* Auth code
*
* @Oauth2Client(
* id = "auth7code",
* name = @Translation("Auth7Code token grant"),
* grant_type = "client_credentials",
* client_id = "$credentials['client_id']",
* client_secret = "$credentials['client_secret']",
* authorization_uri = "https://apis.usps.com//oauth2/v3/token",
* token_uri = "https://apis.usps.com/oauth2/v3/token",
* optionProvider = "\League\OAuth2\Client\OptionProvider\PostAuthOptionProvider",
* success_message = TRUE
* )
*/
In the code you wrote is these two lines
$options = parent::getAccessTokenOptions($method, $params);
$options['headers']['Authorization'] = 'Basic ' . $encodedCredentials;
I know $method is the variable for POST or GET, but I cannot find where it is set
and I know this second $options should in part be
$options['body']['Change to??'] = 'Change to ??' . $encodedCredentials;
If you do not want to assist further - I get it - but this is the way a POST should be sent for security as other locations on the web have said
OK, thanks I will see what I can do in the client form with a for example
if ($grantType == 'client_credentials') {
$form['oauth2_client']['data in body'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enabled'),
'#default_value' => $this->entity->
(),
];
As needed et cetera and it will be a stretch to my skills to cobble together but there is other code helpful on the internet on the issue as it is a common problem one
Thank you. It is working using Postman. It does not work sent as a header, only if credentials are sent in the body.
From what I can tell of the code, the request has no provision in Oauth2Client to be sent in the body
Also the "client credentials" is a POST request not a GET.
This morning when backing out of the response from USPS thrown to the browser for the first time a Drupak message appeared
Updated oauth2 client Auth4Code token grant.
This is from the plugin I built to fail thrown in response to the url window of the browser
https://apis.usps.com//oauth2/v3/authorize?state=d42e366ad0b866095cee735...
I have not been able to reproduce that message
I believe I can hack together the initial token crendential USPS example curl call using my config menu and a temporary postfield of client credentials grant type which should throw a response to the log
Then I will try the Simple oauth module - then I will contact USPS with questions
Is there any way to change code in this module to temporarily throw all responses to the browser???
I am just following the USPS examples of what they say is required. I have not removed urls - I copied the example from USPS. They know how they have setup the authorization flow, and I am only guessing the "code" I mentioned is the prior token received. The specification you linked tends to indicate the authorization server can be set up that way. So without knowing what "CODE" they say is required the access token it would never be granted, and only the client credentials authorization code file might work. After creating a new file and editing it to add the authorize url and then flushing the cache for a rediscovery, still nothing - no error and no sucess message either
USPS is not likely to support this oauth2client module use, so without something caught in the communication to analyze this will never work
I even buit a plugin to throw the "GET" not allowed error into the broweser and it does so on /authorize so communication to USPS is still going on correctly
Something has to going on with JSON
Are you saying to add the code from #11 to the plugin or elsewhere or is it already existing code elsewhere in the module ???
To the plugin throws
ParseError: syntax error, unexpected token "public", expecting end of file in Composer\Autoload\{closure}() (line 41 of /var/www/public_html/modules/xxxxxxxxxxxxxxx/src/Plugin/Oauth2Client/Auth2Code.php).
Severity Error
Removing "public" from the function allows it to run, but no message appears or is logged
As to the "scope" suggestion, it is my understanding until an initial token is obtained there is no API access and then the scope access request issues are then needed. The initial token is critical to moving forward at all. You cannot jump into scope issues at all.
Mine is waiting as
<?php
declare(strict_types=1);
namespace Drupal\xxxxxxxxxxxxxx\Plugin\Oauth2Client;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Access\AccessResultInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\oauth2_client\Plugin\Oauth2Client\Oauth2ClientPluginAccessInterface;
use Drupal\oauth2_client\Plugin\Oauth2Client\Oauth2ClientPluginBase;
use Drupal\oauth2_client\Plugin\Oauth2Client\TempStoreTokenStorage;
/**
* Access code
*
* @Oauth2Client(
* id = "authaccess",
* name = @Translation("Auth Access grant"),
* grant_type = "authorization_code",
* code = "$token",
* redirect_uri = "https://xxxxxxxxxxxxx.com/authorize",
* scope = "prices labels tracking",
* state = "nonce=abscdefg#",
* success_message = TRUE
* )
*/
class AuthAccess extends Oauth2ClientPluginBase implements Oauth2ClientPluginAccessInterface {
/*
* This example assumes that a user is authenticating against a third-party
* service to retrieve a token that Drupal can use to access resources on
* that user's behalf.
*/
use TempStoreTokenStorage;
/**
* {@inheritdoc}
*/
public function codeRouteAccess(AccountInterface $account): AccessResultInterface {
return AccessResult::allowedIfHasPermissions($account, ['access content']);
}
}
The USPS example was originally "code": "{{CODE}}", that I guessed "CODE" was the token I changed to code = "$token",
Of course without a $token there is no variable $token
Chamging the file and rebuilding the cache does no show up changes in the config page for me - only a fresh file and flushing cahes to rediscover works.
Still is there anyway to delete those plugins separately??
Looks like I am going to need to try the actual USPS CURL examples through my other file which will catch the response errors to the log
Thank you, but not frustrated. It simply appears that edits made to the file after discovery in fact do nothing. USPS has a funky Oauth2 implementation. I don't know where it uses it but the CRID and MID is needed before access is granted to the actual API. In the first client credentials the API example says
Prepare your credentials for use in the following examples:
CLIENT_ID=XXXX
CLIENT_SECRET=XXXX
CUSTOMER_REGISTRATION_ID=XXXX
MAILER_ID=XXXX
It is above in number 4 where I answer your question.
I tried editing the file after discovery to change the URLs called to but it kept going to mocklab.io
So if I change the file to remove the space line, I suspect it will do nothing unless I uninstall the Oauth2Client module to destroy the discovered plug-ins and re install and clear caches to cause discovery again
In the examples page from USPS the access grant shows the payload that comes back includes CRID and application name.
It does not show here but I had to add the application by name to my USPS developer account which is then associated with my client_ID, secret, CRID and MID sent of which the MID is a number associated with a mailing location. There can be many MID for each location but only one CRID. You can only get a developer account with a full business account linked to a bank account like for printing labels.
So I don't know, but it is possible no token would be sent without the CRID and MID.
The second pic I attached is a response into the browser from USPS where I used an "authorization code" grant type and it threw a no "GET" allowed error
So it worked to contact USPS for a Token which failed.
I changed it to "client credentials" in the file and there was no error thrown to the browser, but no message in the log either.
I duplicated the file, changed the name and class and re-discovered it and disabled the other and enabled the new one again the same, no error, but no message in the logs.
USPS will return a json payload even if it fails, so that my question on a catch on success or fail.
Renaming the client form to the original means the only way I would know is uninstall the Oauth2_client module and start with a fresh discovery.
That is why I asked how and if the plugins can be separately deleted.
OK - that is where I started before this report, so I put the files back with edited urls - BEFORE - flushing the caches. The pic below shows the result - it worked and I got a "GET" not allowed error on my credentials. See second attached screenshot
The documentation shows the " * " comment frame removed for the "Instagram" access example - while it ony works leaving it in place. I renamed the files to single word titles as classes
You still did not say where does and how does the
$access_token = Drupal::service('oauth2_client.service')->getAccessToken($client_id);
$token = $access_token->getToken();
go in the code??
The documentation should be adjusted to show the proper order to edit the files before flushing the caches to seek discovery
I have edited the client form to include the CRID and MID, but currently it does not save. I am going over the code more closely. Those missing credentials may cause errors also
So does editing the file after discovery do NOTHING?
my "Code.php"file is below
<?php
declare(strict_types=1);
namespace Drupal\commerce_usps\Plugin\Oauth2Client;
use Drupal\oauth2_client\Plugin\Oauth2Client\Oauth2ClientPluginBase;
use Drupal\oauth2_client\Plugin\Oauth2Client\StateTokenStorage;
/**
* Auth code
*
* @Oauth2Client(
* id = "code",
* name = @Translation("Code grant"),
* grant_type = "client_credentials",
* authorization_uri = "https://apis.usps.com/oauth2/v3/token",
* token_uri = "https://apis.usps.com/oauth2/v3/token",
* success_message = TRUE
* )
*/
class Code extends Oauth2ClientPluginBase {
/*
* This example assumes that the Drupal site is using a shared resource
* from a third-party service that provides a service to all uses of the site.
*
* Storing a single AccessToken in state for the plugin shares access to the
* external resource for ALL users of this plugin.
*/
use StateTokenStorage;
}
Thank you for that. I use WinSCP, so I copied the entire "Examples" directory to my module and changed ONLY the namespace. Still nothing until the caches were cleared. Up came the files and the form was accessible; however, if the file is directly modified to remove the "*" - then it does not like the equals sign and throws
ParseError: syntax error, unexpected token "=", expecting ")" in Composer\Autoload\{closure}() (line 18 of modules/commerce_usps/src/Plugin/Oauth2Client/AuthCodeExample.php). and for any line with an " = " sign
Also the clients are impossible to delete, are they entities which must be deleted with entity delete
Thus there is no url to request a token from
I renamed one file to remove the "example" from it php name by duplicating it - and it worke, however still it too is impossible to delete.
Even if I delete the entire Oauth2client directory from the plugin directory still it complains lookin for the old files.
Putting them back will let it work again
But this is still a "BUG" because of the " = " sign issue and th impossibility to delete clients
Where does and how does the
$access_token = Drupal::service('oauth2_client.service')->getAccessToken($client_id);
$token = $access_token->getToken();
go in the code??
It should be noted the "Instagram" connection syntax appears to work with the " : " instead of the " = " sign as at least it does not throw a syntax error, but the file still seems to locked to " oauth.mocklab.io " as the authorization url so it still does not work even I clear the cache and / or rebuild the cache
Then it throws
Drupal\Component\Plugin\Exception\PluginException: Plugin (authcode_example) instance class "Drupal\xxxxxxxxxxx\Plugin\Oauth2Client\AuthCode" does not exist. in Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (line 97 of core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).
finally after that it throws
ParseError: syntax error, unexpected token "class" in Composer\Autoload\{closure}() (line 38 of modules/xxxxxxxxxxxxx/src/Plugin/Oauth2Client/AuthCodeExample.php).
and in the end after editing anything the plugin seems to no longer exist
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "authcode_example" plugin does not exist. Valid plugin IDs for Drupal\oauth2_client\PluginManager\Oauth2ClientPluginManager are: resource_owner_example, authcode_access_example, authcode_redirect_example in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Yes I did that. I copied all four examples, changed the namespace to the module name, and put it in Plugin/Oauth2Client under the "src" directory of my module and adjusted the files removing "Example" from everywhere it was found and replaced theurls with the correct ones for USPS and removed the " * " from the " @0auth2Client( " code
There is nothing in admin/config/Oauth2-client and says no clients are configured yet
A "CRID" - Customer Registration Identification and a "MID" - Mailer Identification. The Postal service shows the example
Prepare your credentials for use in the following examples:
CLIENT_ID=XXXX
CLIENT_SECRET=XXXX
CUSTOMER_REGISTRATION_ID=XXXX
MAILER_ID=XXXX
Example OAuth Client Credentials Token request:
curl -X 'POST' 'https://apis.usps.com/oauth2/v3/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "{{CLIENT_ID}}",
"client_secret": "{{CLIENT_SECRET}}",
"grant_type": "client_credentials"
}'
at https://github.com/USPS/api-examples using CURL.
However I do not get the form Oauth2ClientForm.php anywhere
In the above example I simply used the small case code call and Oauth2_client does not report any installed clients
bobburns → created an issue.
The first issue is Oauth2 authentication. I have installed the Oauth2_client and modified the schema yml file to add the crid and mid needed to get a token, however the form did not change even after clearing the cache, but I did not uninstall and reinstall the new modified version.
It appears the API is the same but there is an issue of xml along with the Oauth2 authentication.
USPS lists the deprecated and new calls that can be manually changed.
There is a notice that USPS works with Oauth2 v3 and it appears Drupal 10 Oauth2_client is v4 possibly. Do not know if it is backward compatible if so.
My credentials work as I used that first script to test a flow connection - it connected but threw an error on the code for request
I have not modified the Oauth2 client for the USPS requests in commerce_usps yet because until I get the API information config section working with the four values I have ready to there it matters not. There is also an issue it may use the "key" module.
Once I do that the Oauth2_client will see the client and register it.
Does anyone know if I need to do more than modify the schema yml to get the config file to change???
It seems easiest to use the Oauth2_client to authenticate integrating the existing Commerce USPS module and adding the new API calls.
Is anyone working on this???
It appears related to a database table modification for an entity id
See for example https://www.drupal.org/project/group/issues/3381083 💬 Errors upgrading from 1.5 -> 2.1 (with config entities) Active
Perhaps it won't happen on a fresh install of version 3 but hacking tables is beyond me, a database update to the install file or sql patch is needed it appears
bobburns → created an issue.
Bec
Not a duplicate because the patch I applied to make work is not committed to the Project and each update crashes until it is applied
bobburns → created an issue.
That patch is applied and it still does not work
bobburns → created an issue.
First the auto update through Drupal did not work so I moved the module of beta1 and expanded beta2 download as a TAR gz in its place
Then I tried to edit a node with ckeditor from the content area - that threw the rrror
I moved the beta1 module back in and changed the info files to beta2 so the update notification would not come back
When I swapped the beta2 back in and tried to edit the node it threw the error again
This through an Android Chrome browser - it should be noted this browser when editing throws double words which the ckeditor people could not figure out
I fired up a terminal on another computer and did a "drush cache:rebuild" and went to the Android Chrome browser and recycled it and ckeditor in edit mode came up after a long wait - about two minutes
It appears to be working after the cache rebuild
Here is the full trace error the second time
ArgumentCountError: Too few arguments to function Drupal\domain\DomainElementManager::__construct(), 1 passed in /var/www/public_html/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 2 expected in Drupal\domain\DomainElementManager->__construct() (line 58 of modules/domain/domain/src/DomainElementManager.php).
Drupal\Component\DependencyInjection\Container->createService(Array, 'domain.element_manager') (Line: 179)
Drupal\Component\DependencyInjection\Container->get('domain.element_manager') (Line: 197)
Drupal::service('domain.element_manager') (Line: 275)
domain_access_form_node_form_alter(Array, Object, 'node_page_edit_form') (Line: 552)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_page_edit_form') (Line: 88)
Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler->alter(Array, Array, Object, 'node_page_edit_form') (Line: 834)
Drupal\Core\Form\FormBuilder->prepareForm('node_page_edit_form', Array, Object) (Line: 285)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 52)
Drupal\crawler_rate_limit\CrawlerRateLimitMiddleware->handle(Object, 1, 1) (Line: 57)
Drupal\advban\AdvbanMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
bobburns → created an issue.
patch 3474692 throws
Error: Call to a member function getCallable() on string in Twig\Node\Expression\CallExpression->getTwigCallable() (line 350 of /var/www/public_html/vendor/twig/twig/src/Node/Expression/CallExpression.php).
Backtrace
#0 /var/www/public_html/vendor/twig/twig/src/Node/Expression/CallExpression.php(31): Twig\Node\Expression\CallExpression->getTwigCallable()
#1 /var/www/public_html/vendor/twig/twig/src/Node/Expression/FilterExpression.php(71): Twig\Node\Expression\CallExpression->compileCallable(Object(Twig\Compiler))
#2 /var/www/public_html/vendor/twig/twig/src/Compiler.php(99): Twig\Node\Expression\FilterExpression->compile(Object(Twig\Compiler))
#3 /var/www/public_html/vendor/twig/twig/src/Node/PrintNode.php(40): Twig\Compiler->subcompile(Object(Twig\Node\Expression\FilterExpression))
#4 /var/www/public_html/vendor/twig/twig/src/Compiler.php(99): Twig\Node\PrintNode->compile(Object(Twig\Compiler))
#5 /var/www/public_html/vendor/twig/twig/src/Node/Node.php(108): Twig\Compiler->subcompile(Object(Twig\Node\PrintNode))
#6 /var/www/public_html/vendor/twig/twig/src/Compiler.php(99): Twig\Node\Node->compile(Object(Twig\Compiler))
. . . more
bobburns → created an issue.
bobburns → created an issue.
el7cosmos → credited bobburns → .
Needs to be comitted to next release.
Did not work on fresh 4.0.2 download BUT did work on my completley patched 4.0.1 (I renmed to 4.0.2 in the info.yml file)
The fresh download of 4.0.2 did not have function destruct
bobburns → created an issue.
bobburns → created an issue.
I installed the 338400 patch and then uninstalled the custom module I made and no errors have returned
It threw user notices into the log one time
Since this is a core patch, I keep a directory in the modules directory with patches because on the next core upgrade if this is not committed to core the issue will return, and I do not want to dig like a pig for tyruffels to find the patch again
That patch is committed to core and is already applied to 10.3 - I checked the code
I built a mini custom module with the function from #14 and called it "comment_block" with just an info file an module with the function and it has removed the errors - but of course does not answer what is causing it
comment_block (in modules directory)
comment_block.info.yml
name: 'Comment Block'
description: 'Blocks comment dependency error'
core_version_requirement: ">=8"
type: module
comment_block.module
<?php
// https://www.drupal.org/project/drupal/issues/3306434 🐛 Fix access checks for bundle permissions to avoid triggering a config validation error Fixed
function comment_block_entity_type_alter(array &$entity_types): void {
if (isset($entity_types['comment_type'])) {
assert($entity_types['comment_type'] instanceof \Drupal\Core\Config\Entity\ConfigEntityTypeInterface);
$route_providers = $entity_types['comment_type']->getRouteProviderClasses();
unset($route_providers['permissions']);
$entity_types['comment_type']->setHandlerClass('route_provider', $route_providers);
}
}
install it and the errors are gone
Same issue after upgrade to 10.3 of as 23, 24, 25, 26, 27
bobburns → created an issue.
Please get this committed to core
It works and the error comes with every core update after fixing it
Yes gone there too - nevewr really ever saw colors there. They show in Claro in update status
I upgraded to the latest Adaptivetheme 6.0 and at_tool 3.0.1 , rebuilt the cache and still no colors
I will admit I did not use composer because there are two projects and one does not work
@tokosefi
I use it and it works. There is a patch for the $layout_path is deprecated etc it is
protected $layout_path;
et cetera for any deprecation that shows up. See eg https://www.drupal.org/project/adaptivetheme/issues/3440936 🐛 Deprecated function (still) RTBC
Use the project/adaptivetheme and at_tool NOT project/at_theme and at_tools - that is not maintained - notice the "s"
Notice adapative theme is now at 6.0 and at_tool is 3.0
There are two adaptive theme projects and if you mix them you get the issues you describe
Install the proper ones once Drupal 10 is working and then generate a new sub theme by slightly changing the name and abandon the old theme, uninstall it and delete it from your files
@tokosefi
I use it and it works. There is a patch for the $layout_path is deprecated etc it is
protected $layout_path;
et cetera for any deprecation that shows up. See eg https://www.drupal.org/project/adaptivetheme/issues/3440936 🐛 Deprecated function (still) RTBC
Use the project/adaptivetheme and at_tool NOT project/at_theme and at_tools - that is not maintained - notice the "s"
Notice adapative theme is now at 6.0 and at_tool is 3.0
There are two adaptive theme projects and if you mix them you get the issues you describe
Install the proper ones then generate a new theme by slightly changing the name and abandon the old theme, uninstall it and delete it from your files
Yes Claro - color returns
I am using Adaptive theme with theme generator for use in differnent domains
Is there a fix??
bobburns → created an issue.
upgrade to version 4.0.0 and it crashes - the patch of 4 appears has fixed it with an added
protected $bundle
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
I cheated and copied the tbody to /tbody code from the same file in the Claro theme
and yet it was not fixed in rhe duplicate wither
Set the config in settings.php but no stack trace beyond this below showed
PHPStan command failed:
/usr/bin/php /var/www/public_html/vendor/bin/phpstan analyse --memory-limit=1500M --error-format=json --configuration=/tmp/upgrade_status/deprecation_testing.neon /var/www/public_html/modules/dynamic_entity_reference
Command output:
Empty.
Command error:
PHP Fatal error: Drupal\Core\DependencyInjection\ContainerNotInitializedException thrown while calling __toString on a Drupal\Core\StringTranslation\TranslatableMarkup object in /var/www/public_html/core/lib/Drupal.php on line 170: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /var/www/public_html/core/lib/Drupal/Component/Utility/ToStringTrait.php on line 20 Fatal error: Drupal\Core\DependencyInjection\ContainerNotInitializedException thrown while calling __toString on a Drupal\Core\StringTranslation\TranslatableMarkup object in /var/www/public_html/core/lib/Drupal.php on line 170: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container. in /var/www/public_html/core/lib/Drupal/Component/Utility/ToStringTrait.php on line 20
From number 4 worked for me on Centos7
2. How to deploy config.zip is confusing and I found the simplest way to do it for a self-hosted Solr server, running on Debian, was to simply stop the solr.service and copy the extracted files into /var/solr/data/{core-name}/conf/ dir, after making a backup.
bobburns → created an issue.
bobburns → created an issue.
Same here
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
I had to change line 184 to
// Render the placeholder into markup.
$markup = $this->renderPlain($placeholder_element);
// return $markup;
return $markup ? $markup : '';
}
or it throws a "null given" error
I can confirm it worked on version 18.2
bobburns → created an issue.
bobburns → created an issue.
Class "Pharborist\Parser" not found in Drupal\drupalmoduleupgrader\Target->open()
How do I fix the pathing to use the vendor directory in the project root?
Android 10 on moto g7 power chrome version 118.0.5993.111
I discovered that it only occurs on the Android Chrome browser, I used it fine on the PC Chrome this morning.
Still does it on Android. I am fine with it - I can put text in enail and paste it into Ckeditor 5 on Android through Chrome.
It is bizarre - Ckeditor 4 worked fine
bobburns → created an issue.
Glad I kept the 9.5 setup in another directory with that working database. I renamed it active for Apache, upgraded to CKeditor5, did the configuration, uninstalled CKeditor 4, copied the database to a new name with phpMyadmin, changed the database name to that in settings.php, ran update.php and 39 databdase updates later, it was all working properly
Thanks for the prompt reply how to fix it.
bobburns → created an issue.
Same thing and it fills my log
Wow - that was easy. Thanks so much. Did not know about that command
It was also holding up database updstes
bobburns → created an issue.
Search api errors from Upgrade Status - coding deeper than I want to go to fix
ISSUE FOUND - ADD
use Drupal\search_api\Utility\DataTypeHelperInterface;
use Drupal\search_api\Utility\ThemeSwitcherInterface;
to top of modules/search_api/src/Utility/FieldsHelper.php
OK - then to fix this
use Drupal\commerce_order\AvailabilityCheckerInterface;
must be added to the top of
commerce/src/AvailabilityManager.php
AND
commerce/src/AvailabilityCheckerInterface.php
BECAUSE
Upgrade Status does not report the
AvailabilityManager.php issue
I had to take the dev version, fix a large number of errors and then rename it to 2.36 straight and I am now left with the 4 issues of the attached jpg
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.
bobburns → created an issue.