Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are cases where it could be useful to expose the entity translation table to views, especially if you create UI:s for translators.
The attached patch adds the entity translation table as a base table, provides handlers for showing a link to the translation overview page for each entity and showing the entity label.
There is also a relationship which makes it possible to join any entity table to the entity translation table.
This can live safely side by side with #1330332: Entity translation: Views field language filter since that probably is going into views.
Comment | File | Size | Author |
---|---|---|---|
#5 | et_views-1524210-5.patch | 4.8 KB | plach |
#9 | et_views-1524210-9.patch | 22.45 KB | plach |
#7 | et_views-1524210-6.interdiff.do_not_test.patch | 4.8 KB | plach |
#7 | et_views-1524210-6.patch | 22.65 KB | plach |
#4 | views-integration-1524210-4.patch | 22.44 KB | fabsor |
Comments
Comment #1
fabsor CreditAttribution: fabsor commentedHere is an updated patch that adds the following:
* I added the possibility of using "Empty" for language filters, the column is never NULL, so I had to create a handler for that.
* I realized while developing a UI for translators that you need to be able to filter out everything that hasn't been translated yet. This is a bit complicated due to the structure of the entity translation table, but I managed to get it working with a subquery. This functionality is in the entity_translation_handler_filter_translation_exists.inc.
Comment #2
plachThanks a lot! Hope to be able to review this soon.
Comment #3
fabsor CreditAttribution: fabsor commentedThere were some bugs with the boolean values when using them as filters. This patch should resolve that.
Comment #4
fabsor CreditAttribution: fabsor commentedOops, forgot the actual views stuff.
Comment #5
plach@fabsor:
Great patch! There were some coding standard issues and a small bug that I fixed myself (see below).
I created the "Views integration" component for the issue queue. I'd like to create a mantainers team (like the core one) whose components will focus on single sub systems to help me scale myself. If you are interested and willing to adhere to the best practices (rules!) described in http://drupal.org/node/363367, I'll be glad to give you commit access and make you the maintainer of the "Views integration" subsystem.
Please note the following excerpt from the link above ;)
See the current MAINTAINERS.txt file.
Wrong comment wrapping (see http://drupal.org/coding-standards).
$values
should not be passed by argument as per the parent method definition.Missing empty line here.
Bogus PHP doc wrapping/text
Comments should start with a capital letter.
Comment #7
plachHm, in #5 I posted the interdiff instead of the full patch.
Comment #9
plachLet's try again. The interdiff should be the same as in #5 and #7.
Comment #10
fabsor CreditAttribution: fabsor commented@plach This is awesome! Thanks for taking time to review and fix my stupid mistakes. The last submitted patch looks good.
This is really a critical part of NodeStream, which I maintain 50% of my time at NodeOne. I can definitely use time from there to ensure the quality of the views integration. I will be happy to help out as co-maintainer of the views component of this module.
Comment #11
plachWelcome to the Entity Translation team! You are welcome to use your new superpowers, remember the changelog entry :)
Dreditor, if you are not already using it, will assist you in creating commit messages.
Comment #12
fabsor CreditAttribution: fabsor commentedCommited and done!