Closed (fixed)
Project:
Smartling Connector
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jul 2017 at 03:29 UTC
Updated:
16 Aug 2017 at 12:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaDigging into this, it seems the recent 7.x-2.96 release switched around Smartling's support for entities from opt-in to opt-out, so that all entities area automatically available. It seems like all that's needed are the necessary views to display the entities, and tests.
Comment #3
damienmckennaThis just adds default views, similar to what smartling_bean does for Beans. No tests yet.
Comment #4
damienmckennaA rudimentary test to make sure the site still works after the module is enabled =)
Comment #5
damienmckennaI did that wrong, forgot the actual test file.
Comment #6
damienmckennaComment #7
damienmckennaAdds support for the smartling_entity_data data relationship in Views.
Comment #8
damienmckennaI was trying to match the functionality available to the node view, specifically the "locales for node" field, but couldn't get it to work, it just doesn't show up for the ECK entity type.
Comment #9
damienmckennaAdds exposed filters.
Comment #10
damienmckennaBTW the last patch changes the logic slightly so that ignores ECK entities that don't support the language property, because they can't be translated.
Comment #11
loparev commentedHi, @DamienMcKenna
Thanks for the patch! I've tested it and found some issues, could you please check?
1. In hook
smartling_eck_views_default_viewsthere is a line$translatables[$view->name] = array(...where you use undefined variable$view->name. I think definition of$translatablesshould go after view definition$view = new view();because it causes warnings:Notice: Undefined variable: view in smartling_eck_views_default_views() (line 29 of /var/www/docroot/sites/all/modules/contrib/smartling/submodules/smartling_eck/smartling_eck.views_default.inc).Notice: Trying to get property of non-object in smartling_eck_views_default_views() (line 29 of /var/www/docroot/sites/all/modules/contrib/smartling/submodules/smartling_eck/smartling_eck.views_default.inc).2. I think we need to clear caches after new entity type is added. In this case we will see a new tab immediately.
3. It would be nice to have an "Author" column in ECK view just like you did for "title" (
if (isset($entity_type->properties['title'])) {...)Comment #12
loparev commentedComment #13
damienmckenna1. Ah, thanks for catching that, I forgot to move the translations after the initial $view definition.
2. I've added some hook implementations that should suffice.
3. I've added the 'uid' property.
This patch contains changes for all three. I don't have time to set up everything to test it, but please give it a try.
Thanks.
Comment #14
loparev commentedFound one more issue. Could you please look at this?
Comment #15
loparev commentedAlso added a filter by
non-undlanguage andlocales_infofield. And query should returnDISTINCTvalues only.Now seems like patch works fine for ECK entities.
Comment #16
loparev commentedSorry here is right patch
Comment #17
soul88The code looks good to me.
Comment #20
loparev commented