Review entity type annotations, look at turning on "show_revision_ui" annotation property, look at "revision_metadata_keys" annotation property.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RoSk0 created an issue. See original summary.

RoSk0’s picture

Status: Active » Needs review
FileSize
12.81 KB

Status: Needs review » Needs work

The last submitted patch, 2: crm_core-2926663-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

RoSk0’s picture

Status: Needs work » Needs review
FileSize
14.12 KB
1.31 KB

Fixed revisions in activities as well.

Status: Needs review » Needs work

The last submitted patch, 4: crm_core-2926663-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

RoSk0’s picture

Status: Needs work » Needs review
FileSize
24.1 KB
13.51 KB

Fixed broken test and coding style issues.

  • RoSk0 committed a63671b on 8.x-1.x
    Issue #2926663 by RoSk0: Improve revision handling.
    

  • RoSk0 committed dca64b9 on 8.x-2.x
    Issue #2926663 by RoSk0: Improve revision handling.
    
RoSk0’s picture

Status: Needs review » Fixed
mikran’s picture

Assigned: Unassigned » mikran
Status: Fixed » Needs work

This one broke existing installations

10:52 $ drush entup
The following updates are pending:

crm_core_individual entity type : 
  The Language field needs to be installed.
  The Revision create time field needs to be installed.
  The Revision user field needs to be installed.
  The Revision log message field needs to be installed.
  The Revision log message field needs to be uninstalled.
  The Name field needs to be updated.
  The Birth date field needs to be updated.
  The Email field needs to be updated.
Do you wish to run all pending updates? (y/n): y
Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException: Unable to delete a field (revision_log in crm_core_individual entity) with data that cannot  [error]
be purged. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldStorageDefinitionDelete() (line 428 of
/var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).
Failed: Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException: !message in                                                                          [error]
Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldStorageDefinitionDelete() (line 428 of
/var/www/html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).
Cache rebuild complete.                                                                                                                                                   [ok]
Finished performing updates.                                                                                                                                              [ok]

I'll start working on a update hook for this.

mikran’s picture

Status: Needs work » Needs review
FileSize
3.2 KB

And the update hook. I've added every field from that `drush entup` output so existing installations with data should not fail anymore.

RoSk0’s picture

Assigned: mikran » Unassigned
Status: Needs review » Closed (won't fix)

Thanks for the code @mikran, but I'm afraid this code doesn't belong to the project. CRM Core doesn't have any releases for Drupal code version 8, particularly it doesn't reached beta stability, it's still work in progress. Until it will reach beta stability we will not provide any upgrade path.

mikran’s picture

ok I'm doing a sandbox project for unofficial update path: https://www.drupal.org/sandbox/mikran/2928183

RoSk0’s picture

Status: Closed (won't fix) » Fixed

Changing status to avoid confusion in future.

Status: Fixed » Closed (fixed)

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