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:
- 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.
- 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.
- 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
- Apply the latest patch in the comments by Project Update Bot or human contributors that made it better.
- Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
- 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.

| Comment | File | Size | Author |
|---|---|---|---|
| #36 | composer_error.png | 191.38 KB | ash2303 |
| #33 | failed_patch_dev_version.png | 41.29 KB | ankondrat4 |
| #31 | failed_3_commis_patch.png | 78.35 KB | ankondrat4 |
| #31 | worked_2_commis_patch.png | 49.45 KB | ankondrat4 |
| #29 | failed_patch.png | 45.16 KB | ankondrat4 |
Issue fork nodeviewcount-3297739
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
Comment #2
project update bot commentedThis 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.ymlfile 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
This patch was created using these packages:
Comment #3
dharti patel commentedComment #4
dharti patel commentedReviewd the automated patch but facing deprecations issues so created child issue for same and working on it.
Thanks
Comment #5
dharti patel commentedTesting 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!
Comment #6
jaydev bhatt commentedComment #7
jaydev bhatt commentedChecked 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
Comment #8
jaydev bhatt commentedComment #9
project update bot commentedThis 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.ymlfile 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
This patch was created using these packages:
Comment #10
project update bot commentedUpdating bot issue summary.See #3313904: Update project bot templates for RTBC status support and human interaction tips
Comment #11
chandra gowsalya kannan commentedApplied 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.
Comment #12
chandra gowsalya kannan commentedComment #13
chandra gowsalya kannan commentedComment #14
shashank5563 commentedI 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!
Comment #15
shashank5563 commentedComment #16
adci_contributor commentedHello 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.
Comment #17
shashank5563 commented@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
Comment #20
shivam_tiwari commentedComment #23
taran2lThe 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)
Comment #24
taran2lComment #25
elkaro commented@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.
Comment #26
aardwolf commented@Taran2L need to add GitlabCI pipeline file to enable automated testing https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...
Comment #27
taran2l@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
Comment #28
Bushra Shaikh commentedI 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
Comment #29
ankondrat4 commentedHello.
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...
Comment #30
ankondrat4 commentedComment #31
ankondrat4 commentedFrom this commit https://git.drupalcode.org/issue/nodeviewcount-3297739/-/commit/b5f5b43c... we have failed MR2 patch
Comment #32
taran2lPatch 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...
Comment #33
ankondrat4 commentedPatch was failed with DEV version too. I have tested on Ubuntu, not on Mac.
Comment #34
taran2lSomehow, it works for me (and it applies as MR shows)
Maybe you are running old(er) patch utility?
Comment #36
ash2303 commentedPlease 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
Comment #37
ankondrat4 commentedHello.
I could apply MR2 as patch only to DEV version of module.
+1RTBC
Comment #38
kerasai commentedThis 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.jsonetc. 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.patchComment #40
adci_contributor commentedThanks 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+