- ๐ท๐บRussia zniki.ru
Nikolay Shapovalov โ made their first commit to this issueโs fork.
- Issue was unassigned.
- ๐ฎ๐ณIndia dev16.addweb
Re-roll the patch according to the latest code changes.
- ๐ฎ๐ณIndia nayana_mvr
Tried to apply the patch #16 on Drupal version 10.4.x and Crop AP module version 8.x-2.x but getting the following error:-
Checking patch crop.module... error: while searching for: * * Provides storage and API for image crops. */ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Form\FormStateInterface; use Drupal\crop\Entity\Crop; use Drupal\image\Entity\ImageStyle; use Drupal\media\Entity\MediaType; use Drupal\media\MediaTypeInterface; use Drupal\media_entity\MediaBundleInterface; use Drupal\file\FileInterface; use Drupal\Core\Routing\RouteMatchInterface; /** * Implements hook_theme(). error: patch failed: crop.module:6 error: crop.module: patch does not apply Checking patch src/CropTypeListBuilder.php... error: while searching for: namespace Drupal\crop; use Drupal\Core\Config\Entity\ConfigEntityListBuilder; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Entity\EntityTypeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Component\Utility\Xss; use Drupal\image\Entity\ImageStyle; /** * Defines a class to build a listing of crop type entities. error: patch failed: src/CropTypeListBuilder.php:2 error: src/CropTypeListBuilder.php: patch does not apply Checking patch src/Entity/Crop.php... Hunk #1 succeeded at 121 (offset 8 lines). error: while searching for: } if (isset($effects['crop_crop']) && $image_style->getEffects() ->has($effects['crop_crop']['uuid'])) { $type = $image_style->getEffect($effects['crop_crop']['uuid']) ->getConfiguration()['data']['crop_type']; $crop = self::findCrop($uri, $type); error: patch failed: src/Entity/Crop.php:154 error: src/Entity/Crop.php: patch does not apply Checking patch src/Form/CropTypeDeleteForm.php... error: while searching for: use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; error: patch failed: src/Form/CropTypeDeleteForm.php:5 error: src/Form/CropTypeDeleteForm.php: patch does not apply Checking patch src/Plugin/ImageEffect/CropEffect.php... Hunk #2 succeeded at 30 (offset 4 lines). error: while searching for: $form['crop_type'] = [ '#type' => 'select', '#title' => t('Crop type'), '#default_value' => $this->configuration['crop_type'], '#options' => $options, '#description' => t('Crop type to be used for the image style.'), ]; return $form; error: patch failed: src/Plugin/ImageEffect/CropEffect.php:140 error: src/Plugin/ImageEffect/CropEffect.php: patch does not apply Checking patch tests/src/Functional/CropFunctionalTest.php... error: while searching for: protected function setUp() { parent::setUp(); $this->adminUser = $this->drupalCreateUser(['administer crop types', 'administer image styles']); // Create test image style. $this->testStyle = $this->container->get('entity_type.manager')->getStorage('image_style')->create([ error: patch failed: tests/src/Functional/CropFunctionalTest.php:49 error: tests/src/Functional/CropFunctionalTest.php: patch does not apply Checking patch tests/src/Functional/UpdatePathTest.php... error: tests/src/Functional/UpdatePathTest.php: No such file or directory Checking patch tests/src/Kernel/CropCRUDTest.php... Checking patch tests/src/Kernel/CropEffectTest.php... error: while searching for: $crop = $this->container->get('entity_type.manager')->getStorage('crop')->create($values); $crop->save(); /** @var $effect \Drupal\crop\Plugin\ImageEffect\CropEffect */ $effect = $this->imageEffectManager->createInstance('crop_crop', ['data' => ['crop_type' => $this->cropType->id()]]); $effect->transformDimensions($dimensions, $file_uri); $this->assertEquals($crop->size(), $dimensions, t('CropEffect::transformDimensions() transform image dimensions correctly.')); } } error: patch failed: tests/src/Kernel/CropEffectTest.php:88 error: tests/src/Kernel/CropEffectTest.php: patch does not apply
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 2960098-fix-phpcs-code to hidden.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- Status changed to Needs work
4 months ago 5:19pm 16 July 2024 - ๐ต๐ญPhilippines roberttabigue
Hi,
I am moving this to 'Needs work', please check the PHPCS issues below after applying the 'MR !14' to the CROP API module against 8.x-2.x-dev on my D10 local.
FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/tests/src/Functional/CropFunctionalTest.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 101 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 109 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 122 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 123 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 142 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 147 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 148 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 152 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 153 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/tests/src/Kernel/CropCRUDTest.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 16 WARNINGS AFFECTING 16 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 75 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 104 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 109 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/tests/src/Kernel/CropEffectTest.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------------------- 95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/src/Form/CropTypeDeleteForm.php ----------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ----------------------------------------------------------------------------------------------------------------------------------------- 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ----------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/src/CropTypeListBuilder.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------------------------------------ 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead 131 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/crop/src/Entity/Crop.php ------------------------------------------------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------------ 124 | WARNING | Exceptions should not be translated 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead ------------------------------------------------------------------------------------------------------------------------------------------ Time: 365ms; Memory: 12MB
Please check.
Thank you! - ๐ฎ๐ณIndia dev2.addweb
nilesh.addweb โ made their first commit to this issueโs fork.
- Status changed to Needs review
4 months ago 8:07am 18 July 2024 - ๐ฎ๐ณIndia dev2.addweb
@roberttabigue,
There is two MR, MR !13 for phpcs and MR !14 for gitlab pipe line,
Please test now I have merge this two MR code in MR !13. - ๐ฎ๐ณIndia dev2.addweb
Hi,
I have fixed the PHPStan issues, and now the PHPStan job, along with all other jobs, has passed successfully. Please review the changes.before --> https://git.drupalcode.org/issue/crop-2960098/-/pipelines/227578
after --> https://git.drupalcode.org/issue/crop-2960098/-/pipelines/227699 - Status changed to RTBC
4 months ago 12:34pm 18 July 2024 - ๐ฎ๐ณIndia riddhi.addweb
I have applied the MR !13 and it resolves all the errors and tested module functionality with the image crop widget and focal point crop.
Please check the Screenshot for the same. - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
apaderno โ changed the visibility of the branch 2960098-gitlab-ci-reports to hidden.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
This issue is only for fixing PHP_CodeSniffer reports, not all the GitLab CI reports.
- ๐ต๐ญPhilippines ambot112
The Merge request !13 is great, it solves all the phpcs and phstan errors.
- ๐ท๐บRussia zniki.ru
Actually, it seems the PHP_CodeSniffer errors/warnings have been already fixed.
Yes @avpaderno, you are right. Right now there are no issues found by CI.
I found that a lot of changes that were implement at MR #6 were merged at ๐ a Drupal 11 dev line is needed for CROP API. RTBC .
CI checks code using only Drupal rules set and DrupalPractice is ignored.
My suggestion to add DrupalPractice as well, using custom phpcs.xml.dist.I update IS using check on latest 8.x-2.x-dev.
MR #6 is ready for review. - ๐ท๐บRussia zniki.ru
nikolay shapovalov โ changed the visibility of the branch 2960098-fix-phpcs-code to active.
- ๐ท๐บRussia zniki.ru
nikolay shapovalov โ changed the visibility of the branch 2960098-fix-phpcs-errors to hidden.