Steps to reproduce

  1. Install Drupal
  2. Enable Language and Content translation
  3. Enable a second language (e.g. Italian)
  4. Enable translation for basic page content type
  5. Create a new basic page
  6. Select Italian for the language instead of English
  7. Save
  8. You are taken to the default/English node path (/node/1) instead of Italian (/it/node/1)

Proposed resolution

Expected result would be to view the translation you just created

Remaining tasks

See comment #16

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Original report

Enabled content translation, such as English and Japanese.

If at English page, i want to add new content, but i selected Japanese language on Language field.

After save, the system will redirect to English content, not Japanese content.

Issue fork drupal-3096570

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

Kang Miao created an issue. See original summary.

Version: 8.7.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Branches prior to 8.8.x are not supported, and Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Status: Needs review » Needs work

The last submitted patch, redirect_language_201911251742.patch, failed testing. View results

raman.b’s picture

Version: 8.9.x-dev » 9.2.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.49 KB
new6.48 KB
new3.34 KB

Resolving failed test case and adding basic test coverage to demonstrate the reported bug

The last submitted patch, 4: 3096570-4-test-only.patch, failed testing. View results

nishat ahmad’s picture

StatusFileSize
new30.62 KB

Disabled Language from Manage form display and check the screenshot.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new143 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

pameeela’s picture

Issue summary: View changes
Issue tags: -node form, -redirect +Bug Smash Initiative

Still happening, updated IS with some clearer steps to reproduce.

ranjith_kumar_k_u’s picture

StatusFileSize
new6.9 KB

Re-rolled #4

ranjith_kumar_k_u’s picture

Status: Needs work » Needs review
rinku jacob 13’s picture

StatusFileSize
new397.32 KB
new341.23 KB

I have tested the issue in drupal version 10.1.x (https://simplytest.me/). Applied above patch and i got the solution. Adding Screenshots for the reference . Need RTBC+1

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Patch #13 does solve the issue.

But language_manager should default to NULL and throw a trigger_error that this will be required in D11. For backwards compatibility.
That will need a test to verify the trigger_error is returned.

Then a change record should be added.

ameymudras’s picture

StatusFileSize
new7.15 KB
new1.51 KB

Tried to address the concerns in #16 and it still needs changes to the tests

ameymudras’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

This was my mistake the change record will need to be created and trigger_error updated.

Also there needs to be test coverage of trigger_error.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

heikkiy’s picture

The latest patch does not seem to apply anymore against core 10.2.

leo liao’s picture

StatusFileSize
new7.1 KB

Supports 10.2.x

leo liao’s picture

Version: 11.x-dev » 10.2.x-dev
recrit’s picture

Version: 10.2.x-dev » 11.x-dev

@leo liao thanks for the 10.2 patch. Any code fixes are applied to the latest dev branch - 11.x.

recrit’s picture

The https://www.drupal.org/files/issues/2024-03-01/3096570-22.patch patch applies cleanly to 11.x. I have created the MR 7350 to move this ticket along.
All patches on this issue have been hidden. The MR should be used for any updates.

PENDING WORK - see https://www.drupal.org/project/drupal/issues/3096570#comment-14954234

  1. Need a change record to be created and trigger_error updated
  2. Needs test coverage of trigger_error.
recrit’s picture

PENDING WORK

  1. DONE - Need a change record to be created and trigger_error updated. See Draft CR at https://www.drupal.org/node/3438992
  2. PENDING - Needs test coverage of trigger_error.
recrit’s picture

Attached is static patch of the MR 7350 for 11.x and a patch adapted for 10.3.x

recrit’s picture

Cleaner patch for 10.3.x with no tests

peterwcm’s picture

Could we use the node language instead? In that case, we don't need to introduce a new language service too.
['language' => $node->language()]

recrit’s picture

@peterwcm thank you. Using the node language worked for me and is a lot cleaner. I will update the PR.

recrit’s picture

Status: Needs work » Needs review
StatusFileSize
new0 bytes

MR passed. Attached is an equivalent 10.3.x for any builds still using that.
Disregard the attached 10.3.x patch here, it was an erroneous upload.

recrit’s picture

let's try adding that 10.3.x patch again for any builds still using 10.3.x.

recrit’s picture

10.3.x patch with no tests

peterwcm’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @recrit
The changes look good. The issue applies to new node creation and editing the source language of an existing node, which I think should be the default behaviour. Tested and it worked as suggested.

alexpott’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 6c01bb31917 to 11.x and f86f182a989 to 11.1.x. Thanks!

  • alexpott committed f86f182a on 11.1.x
    Issue #3096570 by recrit, raman.b, ameymudras, ranjith_kumar_k_u,...

  • alexpott committed 6c01bb31 on 11.x
    Issue #3096570 by recrit, raman.b, ameymudras, ranjith_kumar_k_u,...

Status: Fixed » Closed (fixed)

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