Problem/Motivation

Even if Umami isn't a multilingual distribution demo (yet), we should make sure that if people evaluating it adds languages, the content that they will see it's what they would expect.

Proposed resolution

Add content language filter to views.

Remaining tasks

Patch.

User interface changes

Content is filtered by language if more languages are added.

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Status: Active » Needs review
FileSize
10.14 KB

Edited views for adding the negotiated content language filter.

markconroy’s picture

Status: Needs review » Needs work

Hi @penyaskito,

Thanks for working on this. I've given it a manual test and found a regression in the admin/structure/views/view/promoted_items/edit/block_1 view. At the moment, the main block (top left on the homepage) is supposed to be the latest article, and the two beside it are supposed to be recipes.

Your patch seems to allow Articles and Recipes in the first/left block.

mpp’s picture

Indeed, the patch removes the filter for block_1:

-      filters:
-        status:
-          value: '1'
-          table: node_field_data
-          field: status
-          plugin_id: boolean
-          entity_type: node
-          entity_field: status
-          id: status
-          expose:
-            operator: ''
-          group: 1
-        promote:
-          id: promote

Also, shouldn't we use interface language as opposed to content language?

penyaskito’s picture

Status: Needs work » Needs review
FileSize
9.63 KB

Don't know how that happened, this one should be good.
Also updated some views I skipped.

@mpp: It needs to be content language, as what we are showing on those views is content. Usually content negotiated language and user interface negotiated language are the same, and will probably always be the same in Umami, but there are use cases where people want to show the UI in one language and the content in other.

Status: Needs review » Needs work

The last submitted patch, 5: 2999893-umami-views-content-language-5.patch, failed testing. View results

penyaskito’s picture

Status: Needs work » Needs review

QA testbot failure.

Gábor Hojtsy’s picture

The config changes now look fine. Tests are not possible to add without multilingual content first, so needs manual testing for now.

penyaskito’s picture

Maybe the lack of reviews is because of the missing tag.

shaal’s picture

shaal’s picture

We should be able to test this issue's view settings by applying the following patch first #3037111: Import multilingual content into Umami
It includes all the config needed for multilingual + importing sample Spanish content.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

penyaskito’s picture

Any chance this can be RTBCed? I've been using this patch for 6 months for multilingual demos now.

mpp’s picture

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

Status: Reviewed & tested by the community » Needs work

As part of the work being done on #3037111: Import multilingual content into Umami

I spoke with @smaz yesterday.
We are missing in this patch:
Searching content in Umami /search should return results only in the current language.

Gábor Hojtsy’s picture

Is that even configurable? Hm.

markconroy’s picture

I think I'd like to see this at rtbc and a follow up created for the search issue (if it's possible to configure it).

shaal’s picture

Status: Needs work » Reviewed & tested by the community

It's true, search in core doesn't provide an option to search in the current language only.

RTBC - patch #5 is doing exactly what it suppose to do.
Homepage, Articles, and Recipes pages are showing results in the current language only which is great!

(tested with multilingual content provided by #3037111: Import multilingual content into Umami)

  • Gábor Hojtsy committed f9ad344 on 8.8.x
    Issue #2999893 by penyaskito, shaal, markconroy, mpp: Ensure umami views...
Gábor Hojtsy’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Reviewed & tested by the community » Fixed

Superb, thanks all!

  • Gábor Hojtsy committed d38d08b on 8.7.x
    Issue #2999893 by penyaskito, shaal, markconroy, mpp: Ensure umami views...

Status: Fixed » Closed (fixed)

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