Hello,

I use entity legal to generate legal informations on my website. I put only the "Legal document" in features as I considerate versions as contents which I handle via feeds (It works great with the EXPERIMENTAL entity support).

Also versions are systematically overriden in features as they change the update date when imported.

Is it possible to desactivate the default version export in features (passing it in strongarm which I can choose to take in account or not) and instead use a drush command (or rules) because I would like to do a 0-touch deploy and not change the feature each time ?

Thanks.

Comments

codesidekick’s picture

Status: Active » Needs review

I've fixed the update date issue with Features and added a hook for overriding the name of the published version without affecting Features to the dev branch.

Either way until Drupal generates the next DEV branch release (should have the date 1st of March) or check it out with GIT and let me know.

If you can test it with your set-up and tell me that everything working as it should, I'll merge into the release branch.

thanks,

enorniel’s picture

The hook works:

I use :

$query = new EntityFieldQuery();
    $query
    ->entityCondition('entity_type', ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME)
    ->propertyCondition('document_name', $legal_document->identifier())
    ->propertyOrderBy('updated', 'DESC');
  $result = $query->execute();

  if (!empty($result[ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME])) {
    $object = $result[ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME][key($result[ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME])];
    $id[] = $object->vid;
    $version = entity_load(ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME, $id);
    $published_version_name = $version[$object->vid]->name;
  }

to use the last updated version automatically.

enorniel’s picture

Small miss.

As the hook is apparently not called when an account is created, the popup doesn't appear or doesn't display the version set in the hook. Is it possible to call that hook also in popup event ?

Thanks.

codesidekick’s picture

Can you describe the process from start to finish?

I can't find any direct references to published_version in the module, everything uses the getter which has the alter hook as far as I can tell - but there might be an edge case that's I'm not getting.

In the userMustAgree function that the message method calls that also calls getPublishedVersion which runs the alter hook so it should be running for every case. If you can debug it and find out what's up I can get a patch in soon and we can get this in full release.

enorniel’s picture

My mistake.

It works. I forgot to set permissions.

Sorry

codesidekick’s picture

Status: Needs review » Reviewed & tested by the community

Great, glad it worked and thanks for helping me improve the module.

I'll roll this into stable as soon as I've finished adding tests for path functionality.

codesidekick’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Commited to 1.5 release.