Drupal Coding standards are not applied to the .module and README.txt file

Created on 3 June 2022, almost 3 years ago
Updated 22 July 2024, 9 months ago

Drupal Coding standards are not applied to the .module and README.txt file

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India Meeni_Dhobale

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India riddhi.addweb

    I tried the #2 patch, but seems like the error is not resolved, after applying the patch. Need to review it.

    FILE: /var/www/html/web/drupal10/web/modules/custom/views_infinite_scroll-3283957/views_infinite_scroll.module
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Template\Attribute.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/drupal10/web/modules/custom/views_infinite_scroll-3283957/src/Plugin/views/pager/InfiniteScroll.php
    -----------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
    -----------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------
    
    
  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • 🇮🇳India deepak5423

    I have pulled the latest changes of 2.0.x branch and Fixed the phpcs error.
    Please review.

  • Status changed to Needs work 9 months ago
  • 🇮🇳India riddhi.addweb

    The patch is not working, throwing error:-

    Checking patch README.txt...
    error: while searching for:
    The Views Infinite Scroll module provides a pager, which allows an infinite
    scroll effect for views. It can work on any view: block, page, etc.
    
    * For a full description of the module visit https://www.drupal.org/project/views_infinite_scroll
    
    * To submit bug reports and feature suggestions, or to track changes visit https://www.drupal.org/project/issues/views_infinite_scroll
    
    
    REQUIREMENTS
    
    error: patch failed: README.txt:14
    error: README.txt: patch does not apply
    Checking patch js/infinite-scroll.js...
    error: while searching for:
        var view = Drupal.views.instances[currentViewId];
        // Remove once so that the exposed form and pager are processed on
        // behavior attach.
        view.$view.removeOnce('ajax-pager');
        view.$exposed_form.removeOnce('exposed-form');
        // Make sure infinite scroll can be reinitialized.
        var $existingPager = view.$view.find(pagerSelector);
        $existingPager.removeOnce('infinite-scroll');
    
        var $newRows = $newView.find(contentWrapperSelector).children();
        var $newPager = $newView.find(pagerSelector);
    
    error: patch failed: js/infinite-scroll.js:44
    error: js/infinite-scroll.js: patch does not apply
    Checking patch logo.png...
    error: logo.png: already exists in working directory
    Checking patch src/EventSubscriber/AjaxResponseSubscriber.php...
    error: while searching for:
    
    use Drupal\views\Ajax\ViewAjaxResponse;
    use Symfony\Component\EventDispatcher\EventSubscriberInterface;
    use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
    use Symfony\Component\HttpKernel\KernelEvents;
    
    /**
    
    error: patch failed: src/EventSubscriber/AjaxResponseSubscriber.php:4
    error: src/EventSubscriber/AjaxResponseSubscriber.php: patch does not apply
    Checking patch src/Plugin/views/pager/InfiniteScroll.php...
    Checking patch tests/src/Functional/IntegrationSmokeTest.php...
    error: while searching for:
      /**
       * {@inheritdoc}
       */
      protected function setUp() {
        parent::setUp();
        $this->drupalLogin($this->createUser(['administer views']));
      }
    
    error: patch failed: tests/src/Functional/IntegrationSmokeTest.php:26
    error: tests/src/Functional/IntegrationSmokeTest.php: patch does not apply
    Checking patch tests/src/FunctionalJavascript/InfiniteScrollTest.php...
    error: while searching for:
      /**
       * {@inheritdoc}
       */
      protected $defaultTheme = 'classy';
    
      /**
       * {@inheritdoc}
       */
      protected function setUp() {
        parent::setUp();
        $this->createContentType([
          'type' => 'page',
    
    error: patch failed: tests/src/FunctionalJavascript/InfiniteScrollTest.php:30
    error: tests/src/FunctionalJavascript/InfiniteScrollTest.php: patch does not apply
    Checking patch views_infinite_scroll.info.yml...
    error: while searching for:
    type: module
    description: A pager which allows an infinite scroll effect for views.
    package: Views
    core_version_requirement: ^8.8 || ^9
    
    dependencies:
     - drupal:views
    
    error: patch failed: views_infinite_scroll.info.yml:2
    error: views_infinite_scroll.info.yml: patch does not apply
    Checking patch views_infinite_scroll.libraries.yml...
    error: while searching for:
        js/infinite-scroll.js : {}
      dependencies:
        - core/jquery
        - core/jquery.once
        - core/drupal
        - core/drupal.debounce
        - views/views.ajax
    
    error: patch failed: views_infinite_scroll.libraries.yml:4
    error: views_infinite_scroll.libraries.yml: patch does not apply
    Checking patch views_infinite_scroll.module...
    error: while searching for:
     * Module file for views_infinite_scroll.
     */
    
    use Drupal\Core\Url;
    use Drupal\Core\Template\Attribute;
    use Drupal\views_infinite_scroll\Plugin\views\pager\InfiniteScroll;
    
    /**
    
    error: patch failed: views_infinite_scroll.module:5
    error: views_infinite_scroll.module: patch does not apply
    
  • Status changed to Needs review 9 months ago
  • 🇮🇳India deepak5423

    please review

  • Status changed to Needs work 9 months ago
  • 🇮🇳India riddhi.addweb

    I tried to apply the patch but it threw an error:- Patch failed to apply

    Checking patch README.txt...
    Checking patch js/infinite-scroll.js...
    error: while searching for:
        var view = Drupal.views.instances[currentViewId];
        // Remove once so that the exposed form and pager are processed on
        // behavior attach.
        view.$view.removeOnce('ajax-pager');
        view.$exposed_form.removeOnce('exposed-form');
        // Make sure infinite scroll can be reinitialized.
        var $existingPager = view.$view.find(pagerSelector);
        $existingPager.removeOnce('infinite-scroll');
    
        var $newRows = $newView.find(contentWrapperSelector).children();
        var $newPager = $newView.find(pagerSelector);
    
    error: patch failed: js/infinite-scroll.js:44
    error: js/infinite-scroll.js: patch does not apply
    Checking patch logo.png...
    error: missing binary patch data for 'logo.png'
    error: binary patch does not apply to 'logo.png'
    error: logo.png: patch does not apply
    Checking patch src/EventSubscriber/AjaxResponseSubscriber.php...
    error: while searching for:
       * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
       *   The response event, which contains the possible AjaxResponse object.
       */
      public function onResponse(\Symfony\Component\HttpKernel\Event\ResponseEvent $event) {
        $response = $event->getResponse();
    
        // Only alter views ajax responses.
    
    error: patch failed: src/EventSubscriber/AjaxResponseSubscriber.php:38
    error: src/EventSubscriber/AjaxResponseSubscriber.php: patch does not apply
    Checking patch src/Plugin/views/pager/InfiniteScroll.php...
    Checking patch tests/src/FunctionalJavascript/InfiniteScrollTest.php...
    Checking patch views_infinite_scroll.info.yml...
    error: while searching for:
    type: module
    description: A pager which allows an infinite scroll effect for views.
    package: Views
    core_version_requirement: ^8.8 || ^9
    
    dependencies:
     - drupal:views
    
    error: patch failed: views_infinite_scroll.info.yml:2
    error: views_infinite_scroll.info.yml: patch does not apply
    Checking patch views_infinite_scroll.libraries.yml...
    error: while searching for:
        js/infinite-scroll.js : {}
      dependencies:
        - core/jquery
        - core/jquery.once
        - core/drupal
        - core/drupal.debounce
        - views/views.ajax
    
    error: patch failed: views_infinite_scroll.libraries.yml:4
    error: views_infinite_scroll.libraries.yml: patch does not apply
    Checking patch views_infinite_scroll.module...
    
  • Status changed to Needs review 9 months ago
  • 🇮🇳India deepak5423

    Hi @riddhi.addweb,
    Please try to apply patch on 2.0.x, and if its still not works please let me know

  • Status changed to Needs work 9 months ago
  • 🇮🇳India riddhi.addweb

    Hii @deepak5423 I tried to apply the MR7 patch in 2.0.x, and it is still not working. Please review I have also attached the SS of the branch

    Checking patch README.txt...
    Checking patch js/infinite-scroll.js...
    error: while searching for:
        var view = Drupal.views.instances[currentViewId];
        // Remove once so that the exposed form and pager are processed on
        // behavior attach.
        view.$view.removeOnce('ajax-pager');
        view.$exposed_form.removeOnce('exposed-form');
        // Make sure infinite scroll can be reinitialized.
        var $existingPager = view.$view.find(pagerSelector);
        $existingPager.removeOnce('infinite-scroll');
    
        var $newRows = $newView.find(contentWrapperSelector).children();
        var $newPager = $newView.find(pagerSelector);
    
    error: patch failed: js/infinite-scroll.js:44
    error: js/infinite-scroll.js: patch does not apply
    Checking patch logo.png...
    error: missing binary patch data for 'logo.png'
    error: binary patch does not apply to 'logo.png'
    error: logo.png: patch does not apply
    Checking patch src/EventSubscriber/AjaxResponseSubscriber.php...
    error: while searching for:
       * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
       *   The response event, which contains the possible AjaxResponse object.
       */
      public function onResponse(\Symfony\Component\HttpKernel\Event\ResponseEvent $event) {
        $response = $event->getResponse();
    
        // Only alter views ajax responses.
    
    error: patch failed: src/EventSubscriber/AjaxResponseSubscriber.php:38
    error: src/EventSubscriber/AjaxResponseSubscriber.php: patch does not apply
    Checking patch src/Plugin/views/pager/InfiniteScroll.php...
    Checking patch tests/src/FunctionalJavascript/InfiniteScrollTest.php...
    Checking patch views_infinite_scroll.info.yml...
    error: while searching for:
    type: module
    description: A pager which allows an infinite scroll effect for views.
    package: Views
    core_version_requirement: ^8.8 || ^9
    
    dependencies:
     - drupal:views
    
    error: patch failed: views_infinite_scroll.info.yml:2
    error: views_infinite_scroll.info.yml: patch does not apply
    Checking patch views_infinite_scroll.libraries.yml...
    error: while searching for:
        js/infinite-scroll.js : {}
      dependencies:
        - core/jquery
        - core/jquery.once
        - core/drupal
        - core/drupal.debounce
        - views/views.ajax
    
    error: patch failed: views_infinite_scroll.libraries.yml:4
    error: views_infinite_scroll.libraries.yml: patch does not apply
    Checking patch views_infinite_scroll.module...
    
Production build 0.71.5 2024