Closed (fixed)
Project:
Cloud
Version:
7.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
28 Feb 2024 at 02:43 UTC
Updated:
17 Mar 2024 at 10:59 UTC
Jump to comment: Most recent, Most recent file
$ php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --no-progress || EXIT_CODE=$?
------ ----------------------------------------------------------------------------------
Line modules/cloud_cluster_worker/src/Form/Config/CloudClusterWorkerAdminSettings.php
------ ----------------------------------------------------------------------------------
267 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ----------------------------------------------------------------------------------
------ ------------------------------------------------------------------
Line modules/cloud_service_providers/aws_cloud/aws_cloud.module
------ ------------------------------------------------------------------
1748 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
2100 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
2113 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
2174 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ------------------------------------------------------------------
------ -----------------------------------------------------------------------------
Line modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php
------ -----------------------------------------------------------------------------
534 Call to deprecated method formatExample() of class
Drupal\Core\Datetime\Element\Datetime:
in drupal:10.2.0 and is removed from drupal:11.0.0.
There is no replacement.
------ -----------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------
Line modules/cloud_service_providers/aws_cloud/src/Service/AwsCloud/AwsCloudOperationsService.php
------ ----------------------------------------------------------------------------------------------
5258 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------
Line modules/cloud_service_providers/aws_cloud/src/Service/Ec2/Ec2BatchOperations.php
------ ----------------------------------------------------------------------------------
1580 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
1589 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
1591 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
------ ----------------------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line modules/cloud_service_providers/docker/src/Service/DockerService.php
------ ----------------------------------------------------------------------
410 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ----------------------------------------------------------------------
------ ---------------------------------------------------------------------
Line modules/cloud_service_providers/k8s/k8s.module
------ ---------------------------------------------------------------------
790 Call to static method getOptionsListByRegion() on an unknown class
Drupal\Core\DateTime\TimeZoneFormHelper.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
1092 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ---------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------------
Line modules/cloud_service_providers/k8s/tests/src/Unit/Plugin/cloud/launch_template/K8sCloudLaunchTemplatePluginTest.php
------ ----------------------------------------------------------------------------------------------------------------------
79 Missing call to parent::setUp() method.
------ ----------------------------------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------
Line modules/cloud_service_providers/k8s/tests/src/Unit/Plugin/cloud/project/K8sCloudProjectPluginTest.php
------ -------------------------------------------------------------------------------------------------------
89 Missing call to parent::setUp() method.
------ -------------------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------
Line modules/cloud_service_providers/openstack/openstack.module
------ ----------------------------------------------------------------
327 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ---------------------------------------------------------------------------------
Line modules/cloud_service_providers/openstack/src/Service/Rest/OpenStackService.php
------ ---------------------------------------------------------------------------------
8017 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ---------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------------------------------------------------------------
Line modules/cloud_service_providers/openstack/tests/src/Unit/Plugin/cloud/launch_template/OpenStackCloudLaunchTemplatePluginTest.php
------ ----------------------------------------------------------------------------------------------------------------------------------
71 Missing call to parent::setUp() method.
------ ----------------------------------------------------------------------------------------------------------------------------------
------ ----------------------------------------------------------------------------
Line modules/cloud_service_providers/terraform/src/Service/TerraformService.php
------ ----------------------------------------------------------------------------
543 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ----------------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line modules/cloud_service_providers/vmware/src/Service/VmwareService.php
------ ----------------------------------------------------------------------
436 Call to deprecated function watchdog_exception():
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
Use \Drupal\Core\Utility\Error::logException() instead.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Controller/CloudConfigController.php
------ ----------------------------------------------------------------
109 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
132 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Controller/CloudLaunchTemplateController.php
------ ----------------------------------------------------------------
120 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
143 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
188 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Controller/CloudProjectController.php
------ ----------------------------------------------------------------
120 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
143 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
186 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Controller/CloudStoreController.php
------ ----------------------------------------------------------------
119 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
142 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
185 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ------------------------------------------------------------------
Line src/Form/CloudConfigRevisionDeleteForm.php
------ ------------------------------------------------------------------
128 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
138 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
------ ------------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Form/CloudConfigRevisionRevertForm.php
------ ----------------------------------------------------------------
132 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ------------------------------------------------------------------
Line src/Form/CloudLaunchTemplateRevisionDeleteForm.php
------ ------------------------------------------------------------------
131 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
141 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
------ ------------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Form/CloudLaunchTemplateRevisionRevertForm.php
------ ----------------------------------------------------------------
151 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ------------------------------------------------------------------
Line src/Form/CloudProjectRevisionDeleteForm.php
------ ------------------------------------------------------------------
131 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
141 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
------ ------------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Form/CloudProjectRevisionRevertForm.php
------ ----------------------------------------------------------------
129 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ------------------------------------------------------------------
Line src/Form/CloudStoreRevisionDeleteForm.php
------ ------------------------------------------------------------------
131 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
141 Call to deprecated method deleteRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision
instead.
------ ------------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Form/CloudStoreRevisionRevertForm.php
------ ----------------------------------------------------------------
136 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
------ ----------------------------------------------------------------
Line src/Service/CloudService.php
------ ----------------------------------------------------------------
1723 Call to deprecated method loadRevision() of class
Drupal\Core\Entity\EntityStorageInterface:
in drupal:10.1.0 and is removed from drupal:11.0.0. Use
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision
instead.
------ ----------------------------------------------------------------
[ERROR] Found 44 errors
| Comment | File | Size | Author |
|---|
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
yasComment #4
yas@baldwinlouie
Can you please review the patch? Especially I want you to review the code such as
$cloud_config_storage = $this->entityTypeManager()->getStorage('cloud_config');, which looks invalid, and alsoError::logException()refactoring.Please refer the test results by https://git.drupalcode.org/project/cloud/-/pipelines/105757 and ignore the following error message:
I believe the code
return TimeZoneFormHelper::getOptionsListByRegion()is valid however please correct me if I'm wrong.Thanks!
Comment #5
yasComment #8
yas@baldwinlouie
FYI, I fixed the following error by including the namespace for
Drupal\Core\DateTime\TimeZoneFormHelper::getOptionsListByRegion()Comment #9
yas@baldwinlouie
Thank you for your review. I understood there had the namespace typo. I fixed it, so can you please review the patch again? phpcs and phpstan have been passed successfully :)
Thanks!
Comment #10
baldwinlouie commented@yas, Thank you for working on this patch.
I think the
Error::logException()looks good. My concern is the updates for revision handling.I downloaded and ran this patch to check the
revisionhandling.The usage of
$entity_storage->getRevision($revision_id)causes a 500 error becausegetRevision()method doesn't exist.I've been playing with how to use the
loadRevisionfromRevisionableStorageInterface. I think the following modifications should work.Consider the usage in
updateCloudLaunchTemplateinEc2BatchOperation.php. The following adjustments made it work. You can recreate this error if you try to `Refresh` AWS launch template. The code that refreshes aws launch templates interacts with Revisions.1. Anywhere you need to load entities with revisions, add
PHPDoc commentto add typehinting.2. Change
$entity_storage->getRevisionback to$entity_storage->loadRevision($revision_id);.What do you think?
Comment #11
yas@baldwinlouie
Thank you for your confirmation and suggestion. I added the type hint to avoid the phpstan warnings. I reverted to loadRevision and refactor to use getRevision() if possible.
Can you please review the patch again? Thanks!
Comment #12
baldwinlouie commented@yas, thank you for updating the patch. I posted my second round of comments. Basically, all `getRevision()` should be changed to `loadRevision()`. Otherwise you will encounter errors such as the following screenshot
To reproduce this error.
1. Go to any AWS Launch Template and click "Edit"
2. Then click the "Revisions" tab.
With the current `getRevision()` code, the "Revisions" tab will error out.
Comment #13
yas@baldwinlouie
Thank you for your review. I am sorry for my misunderstanding. I confirmed the patch on local environment, and it works. Can you please check the patch again? Thanks!
Comment #14
baldwinlouie commented@yas, thank you for the update! The patch looks good to me now!
Comment #15
yas@baldwinlouie
Thank you for your review. I'll merge the patch to
7.x, and close this issue as Fixed.Comment #17
yasComment #19
yas@baldwinlouie
I found a bug and fixed it. I'll merge the hotfix to
7.xbranch and close this issue as Fixed. Thanks!Comment #21
yasComment #22
yasI found the following error; so I'll fix it.
TypeError: Drupal\aws_cloud\Service\AwsCloud\AwsCloudOperationsService::__construct(): Argument #1 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\cloud\Plugin\cloud\config\CloudConfigPluginManager given, called in /var/www/cloud_orchestrator/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 260 in Drupal\aws_cloud\Service\AwsCloud\AwsCloudOperationsService->__construct() (line 162 of /var/www/cloud_orchestrator/docroot/modules/contrib/cloud/modules/cloud_service_providers/aws_cloud/src/Service/AwsCloud/AwsCloudOperationsService.php).Comment #24
yasI tested the patch, so it should work.
Comment #25
yas@baldwinlouie
I'll merge the hotfix to
7.xbranch and close this issue as Fixed. Thanks!Comment #27
yas