Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches will be posted by the Project Update Bot official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated patches until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD10" tag is left on this issue, new patches will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the patches posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Providing feedback

If there are problems with one of the patches posted by the Project Update Bot, such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue.

Command icon Show commands

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

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new7.18 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.

Currently Drupal Rector, version 0.13.0, cannot fix all Drupal 10 compatibility problems.

This patch does not update the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0
dharti patel’s picture

Assigned: Unassigned » dharti patel
Issue summary: View changes
dharti patel’s picture

StatusFileSize
new22.19 KB

Reviewd the automated patch but facing deprecations issues so created child issue for same and working on it.

Thanks

dharti patel’s picture

Assigned: dharti patel » Unassigned

Testing Steps:
1. Install the Node view count module (8.x-1.x-dev) version on drupal 9
2. Checked the upgrade status module. (Note: 19 Deprecations issues)
3. Get the patch form the child issue Fix the deprecation issues
4. Apply patch in the drupal 9 in Node view count module and check the upgrade status (Note:- After apply patch 0 issues)
5. Install drupal 10
6. Install the Node view count module module (8.x-1.x-dev) on drupal 10
7. Apply patch in the Node view count module
8. Enable the module and reload the page
9. Now this module is enabled and also install successfully

The module has been successfully installed on Drupal 10, it can now be moved to RTBC. RTBC+1

Thanks!

jaydev bhatt’s picture

Assigned: Unassigned » jaydev bhatt
jaydev bhatt’s picture

Assigned: jaydev bhatt » Unassigned
StatusFileSize
new11.54 KB

Checked the automated patch works well. with drupal 9
ran the module through upgrade_status and found depricated code still remaining.
adding a patch to update that as well.

No more depricated code remaining after this.
keeping this in NW to check this patch as well.
after that can be moved to RTBC
RTBC+1

jaydev bhatt’s picture

project update bot’s picture

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.

Currently Drupal Rector, version 0.13.1, cannot fix all Drupal 10 compatibility problems.

This patch does not update the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #145

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.1
project update bot’s picture

chandra gowsalya kannan’s picture

Applied patch #7 and tested in Drupal 9.5.7 and D 10 . The functionality is working as expected , attached screenshot for reference. Got some deprecated errors related to Call to Undefined method etc. Resolved that issue in my patch and tested.
Rest of the issue are ignorable for which attached in screenshot.

chandra gowsalya kannan’s picture

chandra gowsalya kannan’s picture

StatusFileSize
new2.94 KB
shashank5563’s picture

StatusFileSize
new7.56 KB
new24.46 KB
new12.57 KB

I checked the automated patch #2 works well with drupal 9. But, This patch does not update the info.yml file for Drupal 10 compatibility.
I have updated the info.yml after that i install this module and found it is working fine with Drupal 10.

Testing Steps:

PHP Version: 8.1.16
Database: 10.4.28-MariaDB-1:10.4.28+maria~ubu2004-log
Drupal Version: 10.0.7
Module Branch: 8.x-1.x

1. Install Drupal 10
2. Install the Node view count module module (8.x-1.x) on Drupal 10
3. Apply patch in the Node view count module
4. Enable the module and reload the page
5. Now this module is enabled and also install successfully

The module has been successfully installed on Drupal 10, I am moving it to RTBC.

Thanks!

shashank5563’s picture

Status: Needs review » Reviewed & tested by the community
adci_contributor’s picture

Status: Reviewed & tested by the community » Needs work

Hello shashank5563. I checked your patch for compatibility with Drupal 10. The module turned on at first glance without problems, but I tried to run the tests, and they all failed. I guess before creating a new release we should fix the tests first and after that check module codebase manually.

shashank5563’s picture

@adci_contributor, Some phpunit test is not working on my local. So, I need to first fix the my phpunit test on local after that i will look these issue.

Thanks

shivam_tiwari made their first commit to this issue’s fork.

shivam_tiwari’s picture

Status: Needs work » Needs review

ayush9598 made their first commit to this issue’s fork.

Taran2L made their first commit to this issue’s fork.

taran2l’s picture

The MR has all the changes required to make it 9.5 and 10 compatible + tests are passing now (please enable testing on drupal.org, so we can run them)

taran2l’s picture

elkaro’s picture

@Taran2L https://git.drupalcode.org/project/nodeviewcount/-/merge_requests/2/diff... removes the composer.json file which is needed to directly include the issue fork in a project's root composer.json.

Was there a reason for dropping the composer.json? If not, please bring it back. Thanks.

aardwolf’s picture

@Taran2L need to add GitlabCI pipeline file to enable automated testing https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...

taran2l’s picture

@lelkneralfaro, composer.json is not needed unless module has dependencies, which is not the case for this module, in case you want to use it in D10 project, go with the composer lenient plugin, see https://www.drupal.org/docs/develop/using-composer/using-drupals-lenient...

Also MR is open to anyone to change, like me. So, I (probably) broke your setup :) Lenient plugin + static patch (I mean actual file, not a dynamic MR diff) is the way to go

@AardWolf, let me check

Bushra Shaikh’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new24.19 KB
new23.12 KB

I applied MR !2 this works for Drupal 9.5.10 and Drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.5 have been attached for reference:

Can be move to RTBC+1

ankondrat4’s picture

StatusFileSize
new45.16 KB

Hello.

After changes in MR from 14.11.2023 by Roman Pask, MR !2 doesn't apply as expected. Only applied from commits:
https://git.drupalcode.org/issue/nodeviewcount-3297739/-/commit/42ca8c7e...
https://git.drupalcode.org/issue/nodeviewcount-3297739/-/commit/f38210a6...

ankondrat4’s picture

Status: Reviewed & tested by the community » Needs review
ankondrat4’s picture

StatusFileSize
new49.45 KB
new78.35 KB
taran2l’s picture

Issue summary: View changes

Patch might not apply for the alpha version, have you tried dev version?

Also, the last patch has renames, patches with renames do not work on Mac usually, see https://github.com/cweagans/composer-patches/issues/172#issuecomment-470...

ankondrat4’s picture

StatusFileSize
new41.29 KB

Patch was failed with DEV version too. I have tested on Ubuntu, not on Mac.

taran2l’s picture

Somehow, it works for me (and it applies as MR shows)

Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/nodeviewcount (dev-1.x 2583489): Cloning 2583489107 from cache
  - Applying patches for drupal/nodeviewcount
    https://git.drupalcode.org/project/nodeviewcount/-/merge_requests/2.diff (D10 - MR)

Maybe you are running old(er) patch utility?

ash2303 made their first commit to this issue’s fork.

ash2303’s picture

StatusFileSize
new191.38 KB

Please don't remove composer.json
I do not want extra plugin and commands when I can just add composer.json, which is not causing any harm

ankondrat4’s picture

Status: Needs review » Reviewed & tested by the community

Hello.
I could apply MR2 as patch only to DEV version of module.
+1RTBC

Gathering patches for dependencies. This might take a minute.
  - Installing drupal/nodeviewcount (dev-1.x 2583489): Cloning 2583489107 from cache
  - Applying patches for drupal/nodeviewcount
    https://git.drupalcode.org/project/nodeviewcount/-/merge_requests/2.diff (Automated Drupal 10 compatibility fixes)

Generating optimized autoload files

kerasai’s picture

This patch business is a bit baffling.

I'm running a Lando "drupal9" recipe on Ubuntu. The patch generated from the MR wouldn't apply to either the alpha2 or dev releases. No particular error or indication of what caused the issue, just "could not apply patch".

Assuming the composer patches use the underlying OS patch functionality, I am running the latest version of GNU patch 2.7.6. I've never had an issue such as this before.

Also note, the alpha2 and dev releases reference the same commit so I'd expect them to behave the same. If they do behave differently (for me they both failed) perhaps this is indicative of something going on with the Drupal.org packaging. Perhaps if adds a composer.json etc. to tagged releases and not for dev releases? I don't know that to be the case, just spitballing.

Solution

Not sure if there is a way to do this using the MR or some other functionality within the GitLab, but I ended up pulling the repo locally and made a patch from one of the previous commits.

git diff origin/8.x-1.x...42ca8c7e033607336b2cfcb1262815bfb1c06f99 > nodeviewcount-d10_compatibility.patch

  • adci_contributor committed 20ccc110 on 8.x-1.x
    Issue #3297739 by Taran2L, Chandra Gowsalya Kannan, shashank5563, Jaydev...
adci_contributor’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone for your help!

The latest update is based on a patch from the Project Update Bot + some fixes have been added for tests, etc. Hope this will be a good place to start.
The Dev version should now support Drupal 10. Tests will work correctly starting from Drupal 9.3+

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.