View filter for untranslated contents

Created on 31 May 2016, over 8 years ago
Updated 20 September 2024, 2 months ago

I would like to implement a filter to show only not translated contents.
I implemented a new class extending FilterPluginBase.
I could make it work to have a checkbox on the screen, and found that I have two possibilities for implementing the filtering:
- use query() function - I did not use it as I think I can not check in the same query all things: if content type is set to be translatable, how many languages are set for the cms to be used..and check also if the node has all languages created.
- use postExecute(&$values) - here I can use getTranslationLanguages function of the entity, but I have to unset some rows, so I had problems with paging. I found that I can call postExecute of pager.
Currently my main problem is that it seems postExecute does not run in all cases.. only after clear cache.

If anybody has any idea how to implement filter for untranslated contents, how I can start with this issue, I would be happy to read about it.
If anybody has any idea if I can use postExecute, or I'm absolutely on wrong way, please tell me. Thanks!

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 4 hours ago

Created by

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany vistree

    On Drupal > 10.2 the patch from #13 brings an error when running drush updb:
    Drupal\content_translation\Plugin\views\filter\UnTranslated::operators() must be public

    Attached find a minimal change for the patch from #13

Production build 0.71.5 2024