Hello! It doesn't seem this is a bug, so I'll mark it as a feature request.

Allowing sitewide alerts to be translatable results in a weird behavior where using the language selector when creating a new alert isn't respected and the alert is displayed on all languages. So, if I were to create an alert in french (select french in the language selector), save it and then navigate to English, the french alert would be shown.

I'll update this issue as I venture down the rabbit hole.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

erikbrgn created an issue. See original summary.

erikbrgn’s picture

Status: Active » Needs review
michelecris’s picture

Assigned: Unassigned » michelecris

Hi!
I will try to review this one.

michelecris’s picture

Status: Needs review » Needs work

Hi @erickbrgn

I reviewed your code and your test all passed!

But when I try to reproduce the alerts on drupal, I realize that shows just the default language. If I try to translate other language inside the alert, this isn't showing up when I select the correspondent language. Just if I create a new alert and select default the language I want to show. So I will try to fix that.

michelecris’s picture

Assigned: michelecris » Unassigned
Status: Needs work » Needs review
FileSize
16.11 KB
12.3 KB

Hello!

I made some changes in the code, and now its showing all the messages saved from the current language inside the alert not just the default message that was before. I made some screenshots from alerts module view now. If someone could review that I will aprecciate.

Thanks!

erikbrgn’s picture

Hello @michelecris.

Thanks for the review/feedback!

I think it'd be easier if you'd continued the existing fork/MR instead of creating your own with my changes committed as yours.

I've added a test for the scenario you mentioned, which made me change the approach a little by utilizing EntityQuery and EntityRepository to retrieve alerts instead of relying fully on the storage.

michelecris’s picture

Assigned: Unassigned » michelecris

Hi @erikbrgn

Im sorry about that, Im new here and still learning the rules and how I can help the Drupal community. So I could review your code and see if resolve the problem that I mentioned before here.

michelecris’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
58.59 KB
17.4 KB
19.89 KB

Hello again @erikbrgn!

I reviewed your new aproach in #8 and now its working right!
I run the test and all passed too. And I print my drupal page showing how it was before in 2.x branch and now in your branch MR24 with your new changes and return all correct. So I will change the status for RTBC.

Thanks!

michelecris’s picture

Assigned: michelecris » Unassigned
erikbrgn’s picture

Excellent. Thanks for reviewing, @michelecris :)

andre.bonon’s picture

Adding a "snapshot" patch from #8, as the MR's Diff might change.

ChrisSnyder’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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