Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Issue tags: +Needs tests

Digging 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.

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new8.39 KB

This just adds default views, similar to what smartling_bean does for Beans. No tests yet.

damienmckenna’s picture

StatusFileSize
new385 bytes
new8.43 KB

A rudimentary test to make sure the site still works after the module is enabled =)

damienmckenna’s picture

StatusFileSize
new1.42 KB
new1.42 KB

I did that wrong, forgot the actual test file.

damienmckenna’s picture

StatusFileSize
new9.47 KB
damienmckenna’s picture

StatusFileSize
new10.85 KB
new2.52 KB

Adds support for the smartling_entity_data data relationship in Views.

damienmckenna’s picture

I 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.

damienmckenna’s picture

StatusFileSize
new3.82 KB
new12.74 KB

Adds exposed filters.

damienmckenna’s picture

BTW 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.

loparev’s picture

Hi, @DamienMcKenna

Thanks for the patch! I've tested it and found some issues, could you please check?

1. In hook smartling_eck_views_default_views there is a line $translatables[$view->name] = array(... where you use undefined variable $view->name. I think definition of $translatables should 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'])) {...)

loparev’s picture

Status: Needs review » Needs work
damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new14.04 KB
new3.89 KB

1. 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.

loparev’s picture

StatusFileSize
new14.06 KB
new1021 bytes

Found one more issue. Could you please look at this?

loparev’s picture

StatusFileSize
new14.94 KB
new2.41 KB

Also added a filter by non-und language and locales_info field. And query should return DISTINCT values only.

Now seems like patch works fine for ECK entities.

loparev’s picture

StatusFileSize
new14.94 KB
new718 bytes

Sorry here is right patch

soul88’s picture

The code looks good to me.

loparev’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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