antonín slejška → created an issue.
The following commit solves the issue described in the comment #8:
https://git.drupalcode.org/project/ai_provider_azure/-/commit/052496c055...
When I install "drupal/ai_provider_azure:1.0.x-dev@dev", then the provider works for me. It would be nice to create a new tag.
I experience the same problem with "Azure - OpenAI GPT-4o Mini" model. (It does work with the Gemini provider.)
The problem is, that the method isUsable in the plugin AzureProvider returns FALSE. It returns FALSE, because $operation_type is NULL. The variable is null because it is called without parameters, see: https://git.drupalcode.org/project/ai/-/blob/1.0.5/src/AiProviderPluginM...
The 1.1.3 should work correctly.
- The key.repository argument is not mandatory now: ip_info.services.yml
- And the deploy hook has no dependency to the Key module: ip_info.deploy.php
It is necessary to run the drush deploy:hook
or drush deploy
command!
Maybe, I can create a new version 1.1.2 where the new dependency is installed.
And then I create the version 1.1.3 where the Key module is used.
The hook is executed by drush deploy:hook command.
The problem in the ip_info.deploy.php is, that there is the use statement
use Drupal\key\Entity\Key;
But the module is at the moment not installed.
It is the first time, that I add a new dependency in a contrib module. It looks like I have to just add the dependency without using it and in the following version of the module to add the code using the dependency. I have no idea, how I can solve the problem now.
The deploy hook https://git.drupalcode.org/project/ip_info/-/blob/1.x/ip_info.deploy.php goes through all ip_info keys/tokens in the config ip_info.settings or in the settings.php and creates new keys in the Key module. They relations to the keys are then usedin the ip_info.settings config instead of the keys.
I suppose I have to add the install hook also to the ip_info.deploy.php file. The Key module is installed in the post_update hook. But in the drush deploy command (https://www.drush.org/13.x/deploycommand/) runs config-import after it. This deactivates the Key module. It should be activated in the deploy hook.
Here is the merge request. Could you please review it?: https://git.drupalcode.org/project/ip_info/-/merge_requests/6/diffs
Hi Jürgen,
thanks for the analysis. There is a deploy hook, which should update the ip_info.settings. But I forget to add the update hook, which should enable the Key module.
antonín slejška → created an issue.
Thank you, Jürgen. The MR should solve the issue.
antonín slejška → made their first commit to this issue’s fork.
I will create the "1.0.x" branch for the D10/D11 version of the module. Is it okay for you?
Thank you Bálint!
I have sent Bálint a message using the contact form → .
antonín slejška → created an issue. See original summary → .
I have reviewed the MR, tested the functionality and integrated the new service to the module ip_info → . Thanks for the code and the idea.
There is also another way how to create a service with an optional dependency:
https://eiriksm.dev/services-with-optional-dependencies-drupal-8
I think this is a promising approach.
There is just one last problem in the phpstan test:
Parameter $crowdsecCti of method Drupal\ip_info\Services\CtiFactory::__construct() has invalid type Drupal\crowdsec\Cti.
See: https://git.drupalcode.org/project/ip_info/-/jobs/4436363
It works now. I combine the service provider: https://git.drupalcode.org/project/ip_info/-/merge_requests/3/diffs?file...
with the factory: https://git.drupalcode.org/project/ip_info/-/merge_requests/3/diffs#ae6c...
The following factory service works:
<?php
namespace Drupal\ip_info\Services;
class CtiFactory {
public function getCtiService() {
if (\Drupal::hasService('crowdsec.cti')) {
return \Drupal::service('crowdsec.cti');
}
return new FakeCti();
}
}
But when I try to implement the dependency injection, I have the same problems.
I have tried to implement it: https://git.drupalcode.org/project/ip_info/-/merge_requests/3/diffs
If the module crowdsec is deactivated, it works (nothing is displayed). If the module is enabled, I get the following error message:
TypeError: Drupal\ip_info\Services\CrowdSec::__construct(): Argument #1 ($cti) must be of type Drupal\ip_info\Services\FakeCti, Drupal\crowdsec\Cti given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\ip_info\Services\CrowdSec->__construct() (line 26 of modules/contrib/ip_info/src/Services/CrowdSec.php).
I Integrated the Crowdsec CTI service, but I have not found a way how to inject a service, which possibly does not exist. The following code does work, but it does not apply the Drupal Coding Standards: commit/bcb9fad356f64...
I have tried to decorate the CTI service and make the original service optional. But it did not work.
antonín slejška → created an issue.
antonín slejška → created an issue.
I have the same problem (Drupal 10.4.2, module version 8.x-1.21). The patch solves the problem in Claro but not in Gin Admin Theme.
I am pleased, if the module can help you. I use the module to identify spammers. We had a lot of log messages from the module Honeypot → ...
Hi Dan,
go to Drupal Log (/admin/reports/dblog), click on some log message (/admin/reports/dblog/event/?????), click on the link beside the label "hostname" (/admin/reports/ip/??.??.???.???) . Then you should see something like:
antonín slejška → created an issue.
antonín slejška → created an issue.
antonín slejška → made their first commit to this issue’s fork.
I have the same problem in Gin. The MR looks good for me, and it works (in Gin).
antonín slejška → created an issue.
The patch issue-3202896-7.patch and the diff drupal-3202896-MR9357-11.x--20240828-1.diff look good for me.
The following change solves the problem on our sites: https://git.drupalcode.org/issue/menu_block-3465931/-/commit/9248fe00ca0...
I have not done any tests to see what the effects of this change are. But I hope it helps to localize and understand the problem.
Antonín Slejška → created an issue.
Thank You! 🙏
We use the patch on multiple sites (in production). It works as expected.
I have tested the changes locally. It works for me.
Antonín Slejška → created an issue.
I have:
- added the template page--user--general (it is used in: https://www.drupal.org/project/email_tfa/issues/3247198 📌 Integration with gin_login module Needs review ),
- reviewed the code (it looks good to me),
- tested it on our websites (it works).
I have updated the merge request to be compatible with email_tfa 2.0.
I have added the methods setSitemaps and getSitemaps to the GeneratorInterface. It works: https://git.drupalcode.org/issue/simple_sitemap-3432628/-/pipelines/126371
But I'm not sure, if it is the best solution. Why not to use 'extend'?
Hi @gbyte, I have implemented it, as you suggested. It works by me locally, but it causes the following issues:
https://git.drupalcode.org/issue/simple_sitemap-3432628/-/jobs/1132670
Antonín Slejška → created an issue.
To delete all private or shared tempstores is recently not possible. See:
- the issue 2475719 ✨ Ability to delete/retrieve all items in a PrivateTempStore for a given owner or all owners Needs work ,
- the class DatabaseStorageExpirable,
- the class DatabaseStorage.
Thanks, @clarkssquared, for the review!
Antonín Slejška → created an issue.
Antonín Slejška → created an issue.
Antonín Slejška → created an issue.
The merge request to be reviewed: https://git.drupalcode.org/project/tsk/-/merge_requests/1
Antonín Slejška → created an issue.
I get the following error message after composer update:
Cannot apply patch #3150540 Config in en (patches/core/3150540-30.patch)!
I have started a new test for 3150540-30.patch. The test failed: https://www.drupal.org/pift-ci-job/2657165 →
Thank you @noorulshameera! I have commited and pushed your patch:
https://git.drupalcode.org/project/inxmail_xml/-/commit/af04fa3250a29435...