This is to decide if views should filter results by the current page language by default (but still be configurable to not filter by language).

Comments

klonos’s picture

I personally feel that it is the natural, expected thing in multilanguage sites.

yesct’s picture

This reminds me that long ago, when I used to make views, I would have to add the published == yes filter. That is now a default.

I'm wondering if language filter might be a similar default filter.

There was an irc conversation today where I think @webchick mentioned that @berdir has on occasion mentioned that removing a filter is easier than adding one you didn't know you needed (or dont know how to add).

klonos’s picture

And what you just said reminded me that not long ago I filed #2159085: Make rules revisionsable entities/configuration, because it's really hard to recover/revert from destructive changes when configuring complex modules like rules or views. So, It would be really awesome if we had views configuration be revisionable. I know that we already support reverting changes to the ones that ship with core but this is a full restore - not a step by step undo we could have if there were revisions created.

Another idea would be for individual criteria/filters etc be able to be disabled instead of deleted. That would cover what you said that @berdir mentioned about removing a filter is easier than adding one you didn't know you needed or don't know how to add. Consider the case where people remove the language filter we intent to add here as a default and they then decide that they need back but don't know how to do it.

...but all that's totally OT here. Just saying ;)

plach’s picture

I don't think having filters automagically added to views on multilingual sites is a good idea: we just need to provide people good examples and they will figure out what they need for their particular use cases. This is why I am suggesting to have an optional translation language filter in the front page view: people can use that one as a very clear example of how to achieve what they need, without requiring us to introduce black magic all around in Views just to support multilingual sites.

IMO we should won't fix this.

klonos’s picture

Before won'tfixing, we should talk to people that actually build multilingual sites (I personally do so 95% of the times). The procedure of making the site actually display content in the language that visitors expect is really tedious and site owners get a lot of complaints about it (and they in turn tell us). So I wouldn't call this "black magic" in the case of multilingual setups - just sensible default.

yesct’s picture

Yeah, I'm not sure it's magic, but the proposal is just a filter in views.

In drupal historical fashion we could make a setting for views default so site builders could pick if their views should have a language filter by default or not. (or maybe that would be a contrib module that could do that?)

jhodgdon’s picture

So... I think there are really two questions here:

a) Should the default views provided by various Drupal Core modules, such as the site home page and some admin screens, default to having a "current language" filter? For this, we've already decided the answer is Yes for the site home page, and I think that the answer is "exposed language filter" for the admin page, right? So I guess there is not just one answer here to the question -- have to think case-by-case.

b) Should the wizard that makes views add a "current language" filter by default? Here, I think the best thing to do would actually be to give the user the choice, on the wizard. They could be presented with all of the language choices they'd get if they added the filter to the view, or they could just have a checkbox to turn this filter on or off.

Also, as a note: Node views have been recently fixed on #2217943: Views cannot be filtered by language of translation to have this filter, but it is not clear to me whether or not other entities have a language filter yet. We need to file other child issues of #2313159: [meta] Make multilingual views work if not. Is it OK for this issue to encompass all entities, or should it be specific to Node?

plach’s picture

Let me clarify my thoughts: I agree having current language filters by default would make it easier for site builders to create views that behave more naturally in most use cases. So if the scope of this issue is just identifying which core views should feature (optional) language filters (and how they should be configured) or improving the UX around adding/configuring them (Jennifer's post above makes lot of sense), then I am all for it. What I think we should avoid is silently/automatically adding language filters around or, even worse, hardcoding multilingual filtering logic in Views' core. Multilingual is complex and we should make everything as configurable as possible (and, yes, UX plays a big role here).

jhodgdon’s picture

Status: Active » Postponed

Totally agree: We should not hard-code any language filtering in Views' core. I don't think anyone is advocating that, are they? This question is just about whether the language filters should be turned on by default, I think... assuming that these language filters are actually available in the first place.

So... I think we should actually postpone this issue until a few of the other Views multilingual issues are fixed (see meta issue #2313159: [meta] Make multilingual views work), and then come back and think about what makes sense for defaults for each core views config, and for each entity's wizard. The prerequisite to making decisions here and evaluating the options is basically, I think, that all entity views need to be working consistently and sensibly with languages:
- They all need to be working on the assumption that a row == (entity ID + language), not just entity ID
- Fields need to be working with this assumption and joined to the entity field data table, not just entity table
- All the entities need to have language filters available, which I think have only been added for Node.
- We also need to fix the display so that it is consistent and configurable with respect to language. This is not even true for Node views.

The meta-issue outlines the goals in more detail and has links to actual issues etc.; I just think this issue here is a bit premature until the rest of the system is set up, right?

plach’s picture

I don't think anyone is advocating that, are they?

I had this impression from the parent issues, but if not then we are all on the same page :)

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

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

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

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

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

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

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

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

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

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

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

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

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

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.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.

Version: 8.8.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. 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.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

quietone’s picture

Status: Postponed » Active

From #9

So... I think we should actually postpone this issue until a few of the other Views multilingual issues are fixed (see meta issue #2313159: [meta] Make multilingual views work), and then come back and think about what makes sense for defaults

Most of the issues on the Meta are complete, setting to Active.

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

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should 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.

Version: 9.5.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. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.