Comments

bojanz created an issue. See original summary.

vasike’s picture

Status: Active » Needs review
StatusFileSize
new41.8 KB

indeed without Actions Plugin there will be no bulk update form option in the views.

There is a patch that builds Delete Action Plugins for Commerce Store, Order, Products and Product Variations.
With these plugins, adds the Bulk Update Views elements for their admin Views.

vasike’s picture

@bojanz: i think we need this commited, it helps to delete all the data for commerce entities.
It could help with uninstall/install process - dev/tests.

vasike’s picture

StatusFileSize
new33.24 KB

There is a reroll of the previous patch

Changes
- Do not build the Delete plugin action for product variation (at least for now)
- Change the delete action ids to match the class names : DeleteProduct -> delete_product_action (instead of product_delete_action), the same was done for publish/unpublish
- Small fix for type field for product view : use commerce_product_field_data for table instead of commerce_product (broken handler)

bojanz’s picture

Status: Needs review » Needs work

We are duplicating the action plugin and the delete confirmation form for every entity type, even though nothing changes, can we make that more generic?
(At least the confirmation forms can be 1 class).

vasike’s picture

Status: Needs work » Needs review
StatusFileSize
new28.79 KB

Patch updated
- Use generic \Drupal\commerce\Form\DeleteMultiple ConfirmFormBase
- Use a route parameter to get the entity type with \Drupal::routeMatch()->getParameter('entity_type')
ex.

entity.commerce_product.multiple_delete_confirm:
  path: '/admin/commerce/products/delete'
  defaults:
    _form: '\Drupal\commerce\Form\DeleteMultiple'
    entity_type: 'commerce_product'
  requirements:
    _permission: 'administer products'

- Use singular and plural labels for Entity types definitions so we can have the right labels for deletion messages and questions
@see #1850080: Entity type labels lack plurality, cannot generate UI text based on label if plural is needed

---------------

@bojanz : Questions
- Do you think there is better (Drupal core) way to have the entity type in the DeleteMultiple, instead of the route paramter/routeMatch?
- Do you think we can use also a generic class for Delete Action Plugins (ex. \Drupal\commerce_product\Plugin\Action\DeleteProduct) with an entity type parameter?
- Do you think this could be a Drupal core approach for DeleteMultiple?

fgm’s picture

Assigned: Unassigned » fgm

Working on it at the Paris code sprint.

fgm’s picture

Assigned: fgm » Unassigned

Submitted as a PR for Travis checks : https://github.com/commerceguys/commerce/pull/286

fgm’s picture

PR now passing the tests. Time to merge it ?

vasike’s picture

Status: Needs review » Needs work
StatusFileSize
new4.68 KB

it seems there is an issue with #8 PR, with the form id and there is no deletion (confirm form) for VBO actions.
there is patch that could help for this PR.
The patch contains also some small code "corrections".

vasike’s picture

Entity API issue opened for Delete action : #2650152: Delete action.
So on commerce we should have only Config upates for Actions and Views.

vasike’s picture

Status: Needs work » Needs review
StatusFileSize
new12 KB

and here is patch for testing (and is working only with) the Entity API patch #2650152-2: Delete action

There are only configs (definitions) changes.

vasike’s picture

StatusFileSize
new12.01 KB

reroll #12 patch

bojanz’s picture

Status: Needs review » Needs work
StatusFileSize
new14.57 KB

The Entity API issue landed (https://github.com/fago/entity/pull/29).

The rerolled patch applies locally, but fails Travis.

https://travis-ci.org/drupalcommerce/commerce/jobs/109591541

  • bojanz committed 6da83fd on 8.x-2.x authored by fgm
    Issue #2612572 by vasike, fgm, bojanz: Add bulk operations to the store/...
bojanz’s picture

Status: Needs work » Fixed

The fail was on the Entity API side, committed.

Status: Fixed » Closed (fixed)

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