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.

CommentFileSizeAuthor
#15 Good-Bay-Login-Destination-Real-physical-testing-with-Drupal-10.png153.53 KBrajab natshah
#15 Dashboard-Login-Destination-Real-physical-testing-with-Drupal-10.png146.8 KBrajab natshah
#15 Log-in-Login-Destination-Real-physical-testing-with-Drupal-10.png164.56 KBrajab natshah
#15 Edit-login-destination-rule-Login-Destination-Real-physical-testing-with-Drupal-10--good-bay.png255.43 KBrajab natshah
#15 Edit-login-destination-rule-Login-Destination-Real-physical-testing-with-Drupal-10.png158.78 KBrajab natshah
#15 Login-destinations-Login-Destination-Real-physical-testing-with-Drupal-10.png157.81 KBrajab natshah
#13 login_destination.2.x-dev.rector.patch7.6 KBproject update bot
#13 interdiff-last-bot.6679134.txt1.5 KBproject update bot
#12 Drupal-10-upgrade-status-D95 (5).png26.56 KByashingole
#12 Login-destinations-10.png81.28 KByashingole
#12 Login-destination-Settings-10.png68.14 KByashingole
#11 interdiff-login_destination-3288368-9-11.txt2.19 KBprudloff
#11 login_destination-3288368-11.patch8.77 KBprudloff
#9 login_destination.2.x-dev.rector.patch7.6 KBproject update bot
#9 interdiff-last-bot.6675486.txt1.69 KBproject update bot
#8 login_destination.2.x-dev.rector.patch6.17 KBproject update bot
#8 interdiff-last-bot.6663362.txt898 bytesproject update bot
#7 3288368_7.patch12.28 KBmark_fullmer
#6 3288368_6.patch12.23 KBmark_fullmer
#5 login_dest.png73.3 KBatul_ghate
#5 login.png45.36 KBatul_ghate
#5 interdiff-3-5.txt514 bytesatul_ghate
#5 drupal10_compatiblity-3288368-5.patch7.59 KBatul_ghate
#3 login_destination.2.x-dev.rector.patch6.99 KBproject update bot
#3 interdiff-last-bot.6643915.txt6.46 KBproject update bot
#2 login_destination.2.x-dev.rector.patch874 bytesproject update bot
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
new874 bytes

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.12.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 #127

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.9
  2. palantirnet/drupal-rector: 0.12.0
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 this patch makes this module compatible with Drupal 10! 🎉
This patch updates 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
atul_ghate’s picture

Issue summary: View changes

Hi,
i will review this patch.

atul_ghate’s picture

StatusFileSize
new7.59 KB
new514 bytes
new45.36 KB
new73.3 KB

Verified patch #3 on Drupal 10 Patch applied successfully
Testing Steps:

1. Install drupal 10
2. clone the branch on drupal (8.x-2.x) latest branch on drupal 9 and checked deprecated code uisng upgrade status module
3. removed deprecated code according to upgrade status module , provide a patch #5 ,applied patch #5 and again checked deprecated code on drupal 9
4. and tried to installed module on drupal 10 and drupal 9

The module has been successfully installed, and it can be moved to RTBC+

mark_fullmer’s picture

StatusFileSize
new12.23 KB

As a reminder, if the module has automated tests, they should be run against D10 as part of the testing process. I ran the tests locally and it turned up multiple errors:

Drupal\Tests\login_destination\Functional\InstallTest::testInstallation
Exception: Drupal\Tests\BrowserTestBase::$defaultTheme is required. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
  1x: The Drupal\Tests\login_destination\Functional\InstallTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426
    1x in DrupalListener::startTest from Drupal\Tests\Listeners
TypeError: PHPUnit\Framework\Assert::assertNotContains(): Argument #2 ($haystack) must be of type iterable, string given, called in /var/www/web/modules/contrib/login_destination/tests/src/Functional/UrlParameterTest.php on line 36

The attached patch addresses those issues, and I'll trigger the test run to demonstrate passing tests (note that the test suite includes an integration test with admin_toolbar, so that module needs to be present if testing locally).

mark_fullmer’s picture

StatusFileSize
new12.28 KB

Automated tests on drupal.org are failing because the require-dev version of admin_toolbar is set to 1.23, while that module's D10 compatible version is 3.x.

The attached patch adds the correct composer version requirement, but is otherwise identical to #6.

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.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 #143

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.0
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

prudloff’s picture

Some additional fixes. I chose classy as the default theme base on this explanation but maybe there is a better choice.

yashingole’s picture

I have reviewed and checked Patch #11 this works for drupal 9.5 and drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.5 and Config along with the Setting page on 10 have been attached for reference:

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.

Therefore 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 #8662

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.1
rajab natshah’s picture

Priority: Normal » Major
rajab natshah’s picture

Thanks for maintaining this nice and functional module.

Hoping for a soft commit on the 8.x-2.x branch, and a soft tag release.
Testing now with git clone git@git.drupal.org:project/login_destination.git


Had Real physical testing round for Login Destination with Drupal ~10

composer create-project drupal/recommended-project:~10 /var/www/html/sandboxes/drupal10login_destination__test
cd /var/www/html/sandboxes/drupal10login_destination__test/
composer require drush/drush:~11.0;

cd /var/www/html/sandboxes/drupal10login_destination__test/web/modules
git clone git@git.drupal.org:project/login_destination.git
cd login_destination/
git fetch origin
git checkout 8.x-2.x

Get the patch and apply it under Drupal 10 site. ( to be able to enable )

wget https://www.drupal.org/files/issues/2022-11-28/login_destination-3288368-11.patch
git apply login_destination-3288368-11.patch
rm login_destination-3288368-11.patch

Change file/directory mod and ownership of files:

cd /var/www/html/sandboxes/drupal10login_destination__test/
sudo chmod 775 -R .;sudo chown www-data:$USER -R .;

Install with Drush

./vendor/drush/drush/drush site:install standard --yes --site-name="Login Destination - Real physical testing with Drupal ~10" --account-name="webmaster" --account-pass="d" --account-mail="test@drupal.org" --db-url="mysql://root:123___@localhost/sandboxes_drupal10login_destination__test" -vvv ;
./vendor/drush/drush/drush pm:enable login_destination
[success] Successfully enabled: login_destination

Rebuild the cache:

sudo chmod 775 -R .;sudo chown www-data:$USER -R .;
./vendor/drush/drush/drush cache:rebuild

Open a browser and change the address to:
http://localhost/sandboxes/drupal10login_destination__test/web/

On navigating to "/admin/config/people/login-destination"
navigating to login destinations

And configuring a Dashboard page for directing all logged in users to a dashboard

And a Good Bay page for redirecting after logging out to a good bay message page

When a Test Content Editor login to the site
Test Content Editor login to the site
Then the user will be directed to the Dashboard page
the user will be directed to the Dashboard page

And when a user loges out
Then the user will be directed to the Good Bay page
the user will be directed to the Good Bay page

rajab natshah’s picture

Tested the #11 patch. Thank you Pierre.
It is working for the basic used scenarios.

rajab natshah’s picture

Priority: Major » Critical

Thanks for maintaining this nice and functional module.

Hoping for a soft commit on the 8.x-2.x branch, and a soft tag release.
Testing now with git clone git@git.drupal.org:project/login_destination.git
and git apply for the patch

rajab natshah’s picture

rajab natshah’s picture

Created an issue fork and committed patch #11
Thanks, Pierre.


It was tested in #15
git clone git@git.drupal.org:issue/login_destination-3288368.git
cd login_destination-3288368/
git checkout 3288368-8-x-2-x
wget https://www.drupal.org/files/issues/2022-11-28/login_destination-3288368-11.patch
git apply login_destination-3288368-11.patch
rm login_destination-3288368-11.patch
git add .
git commit -m 'Issue #3288368: Automated Drupal 10 compatibility fixes' --author="Project Update Bot <git@users.noreply.drupalcode.org>"
git push origin 3288368-8-x-2-x
mark_fullmer’s picture

Seconding the RTBC, above, and the priority for getting a new release for this widely-used module.

rajab natshah’s picture

Tested with the #11 patch. Good to release.

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

  • rsvelko committed 5ba35c47 on 8.x-2.x authored by Rajab Natshah
    Issue #3288368 by Project Update Bot, Rajab Natshah, prudloff, rsvelko,...
rsvelko’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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