- Issue created by @banoodle
- πΊπΈUnited States banoodle San Francisco, CA
Uploading a patch that works on current 1.0.x-dev release (and core 11.2).
- π«π·France lazzyvn paris
You can try module field states transition it is 2 times better than content moderate state and kanban is full support module field states transitions
- π«π·France lazzyvn paris
Your patch cannot be merged in dev because it does not respect drupal phpstan and phpcs standards
- πΊπΈUnited States banoodle San Francisco, CA
Attaching new version of patch that fixes my coding standard issues.
- π«π·France lazzyvn paris
this patch is not good at all
If an entity is not a node then it has to run a foreach all rows this is not optimal$ids = []; foreach ($rows as $key => $row) { $revision = $row->_entity; // Get the *node ID* from the revision entity. if ($revision->hasField('nid')) { $nid = $revision->get('nid')->value; $ids[$key] = $nid; } } // Get unique model values and their original keys. $unique_ids = array_unique($ids); // Use array_intersect_key to filter the original $rows array // based on the keys of the unique ids values. $unique_rows = array_intersect_key($rows, $unique_ids); $rows = $unique_rows;
another code can't pass phpstan exemple
you need to use injection dependency. but why does it always have to be node? there are many other entities like user, taxonomy or custom entities ECK?$entity_type_manager = \Drupal::entityTypeManager(); $revision_ids = \Drupal::entityQuery('node') ....