- Issue created by @solideogloria
- First commit to issue fork.
- Merge request !109Issue #3448304: Add accessCheck to entity queries and inject service. → (Open) created by Unnamed author
- Status changed to Needs review
9 months ago 6:11am 24 May 2024 - Status changed to Needs work
9 months ago 1:51pm 24 May 2024 - 🇵🇹Portugal jcnventura
Also NW for the removal of a valid comment with a pointless "Use the injected module handler service to check module existence", which basically describes the inserted line, but doesn't really say WHY the line is there.
The other funny part is that the patch does a lot to remove a call to \Drupal calls, but proceeds to then replace that with a \Drupal call in another class.
- Status changed to Needs review
8 months ago 5:29am 4 July 2024 - 🇮🇳India atul_ghate
Hi @jcnventura,
Thank you for your feedback. I have fixed all the PHPCS issues and updated the code as per your suggestions. Please review the changes and let me know if any further modifications are required.
- Status changed to Needs work
6 months ago 6:51am 4 September 2024 - 🇮🇳India Tirupati_Singh
Hi @atul_ghate, I tried applying the provided MR as a patch and getting errors while applying the patch.
/openid_connect$ curl https://git.drupalcode.org/project/openid_connect/-/merge_requests/109.patch | git apply -v % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 18250 0 18250 0 0 37404 0 --:--:-- --:--:-- --:--:-- 37397 Checking patch src/Entity/OpenIDConnectClientEntity.php... Checking patch src/Form/OpenIDConnectClientFormBase.php... Checking patch src/Plugin/OpenIDConnectClientCollection.php... Checking patch src/Controller/OpenIDConnectRedirectController.php... error: while searching for: use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; use Drupal\externalauth\AuthmapInterface; use Drupal\openid_connect\OpenIDConnectClaims; use Drupal\openid_connect\OpenIDConnect; use Drupal\openid_connect\OpenIDConnectClientEntityInterface; use Drupal\openid_connect\OpenIDConnectSessionInterface; use Drupal\openid_connect\OpenIDConnectStateTokenInterface; use Drupal\openid_connect\Plugin\OpenIDConnectClientInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** error: patch failed: src/Controller/OpenIDConnectRedirectController.php:17 error: src/Controller/OpenIDConnectRedirectController.php: patch does not apply Checking patch src/Entity/OpenIDConnectClientEntity.php... error: while searching for: use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\openid_connect\OpenIDConnectClientEntityInterface; use Drupal\openid_connect\Plugin\OpenIDConnectClientInterface; use Drupal\openid_connect\Plugin\OpenIDConnectClientCollection; /** * Defines the OpenID Connect client entity. error: patch failed: src/Entity/OpenIDConnectClientEntity.php:4 error: src/Entity/OpenIDConnectClientEntity.php: patch does not apply Checking patch src/Form/OpenIDConnectClientFormBase.php... Checking patch src/OpenIDConnect.php... error: while searching for: LoggerChannelFactoryInterface $logger, FileSystemInterface $fileSystem, OpenIDConnectSessionInterface $session, FileRepositoryInterface $fileRepository ) { $this->configFactory = $config_factory; $this->authmap = $authmap; error: patch failed: src/OpenIDConnect.php:174 error: src/OpenIDConnect.php: patch does not apply Checking patch src/OpenIDConnectAutoDiscover.php... error: while searching for: namespace Drupal\openid_connect; use Drupal\Core\Http\ClientFactory; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use GuzzleHttp\Exception\RequestException; use Drupal\Component\Serialization\Json; /** * OpenID Connect well-known URI discovery service. error: patch failed: src/OpenIDConnectAutoDiscover.php:2 error: src/OpenIDConnectAutoDiscover.php: patch does not apply Checking patch src/Plugin/OpenIDConnectClientBase.php... error: while searching for: namespace Drupal\openid_connect\Plugin; use Drupal\Component\Serialization\Json; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\GeneratedUrl; error: patch failed: src/Plugin/OpenIDConnectClientBase.php:2 error: src/Plugin/OpenIDConnectClientBase.php: patch does not apply Checking patch src/Plugin/OpenIDConnectClientCollection.php... Checking patch tests/src/Unit/Entity/OpenIDConnectClientEntityTest.php... error: while searching for: <?php declare(strict_types = 1); namespace Drupal\Tests\openid_connect\Unit\Entity; error: patch failed: tests/src/Unit/Entity/OpenIDConnectClientEntityTest.php:1 error: tests/src/Unit/Entity/OpenIDConnectClientEntityTest.php: patch does not apply Checking patch tests/src/Unit/OpenIDConnectStateTokenTest.php... error: while searching for: <?php declare(strict_types = 1); namespace Drupal\Tests\openid_connect\Unit; use Drupal\openid_connect\OpenIDConnectSessionInterface; use Drupal\Tests\UnitTestCase; use Drupal\openid_connect\OpenIDConnectStateToken; /** * Test the OpenIDConnectStateToken class. error: patch failed: tests/src/Unit/OpenIDConnectStateTokenTest.php:1 error: tests/src/Unit/OpenIDConnectStateTokenTest.php: patch does not apply Checking patch tests/src/Unit/OpenIDConnectTest.php... error: while searching for: <?php declare(strict_types = 1); namespace Drupal\Tests\openid_connect\Unit; use Drupal\Component\Serialization\Json; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandler; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Messenger\MessengerInterface; use Drupal\Core\Session\AccountProxyInterface; use Drupal\externalauth\AuthmapInterface; use Drupal\externalauth\ExternalAuthInterface; use Drupal\file\FileRepositoryInterface; use Drupal\openid_connect\OpenIDConnectClientEntityInterface; use Drupal\openid_connect\OpenIDConnectSessionInterface; use Drupal\openid_connect\Plugin\OpenIDConnectClientInterface; use Drupal\Tests\UnitTestCase; use Drupal\user\Entity\User; use Drupal\user\UserDataInterface; use Drupal\openid_connect\OpenIDConnect; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\user\UserInterface; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Entity\EntityTypeRepositoryInterface; use Drupal\file\Entity\File; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\File\FileSystemInterface; use Psr\Log\InvalidArgumentException; /** error: patch failed: tests/src/Unit/OpenIDConnectTest.php:1 error: tests/src/Unit/OpenIDConnectTest.php: patch does not apply Checking patch tests/src/Unit/OpenIdConnectClaimsTest.php... error: while searching for: <?php declare(strict_types = 1); namespace Drupal\Tests\openid_connect\Unit; error: patch failed: tests/src/Unit/OpenIdConnectClaimsTest.php:1 error: tests/src/Unit/OpenIdConnectClaimsTest.php: patch does not apply Checking patch tests/src/Unit/OpenIdConnectSessionTest.php... error: while searching for: <?php declare(strict_types = 1); namespace Drupal\Tests\openid_connect\Unit; error: patch failed: tests/src/Unit/OpenIdConnectSessionTest.php:1 error: tests/src/Unit/OpenIdConnectSessionTest.php: patch does not apply
Hence, moving issue to Needs work.
- Status changed to Needs review
5 months ago 11:42am 18 September 2024 - 🇮🇳India atul_ghate
Hi @tirupati_singh,
I was able to apply this patch cleanly, and it resolved all the PHPCS issues. (See the attached screenshot.)