0

Using Commerce Kickstart 2.

We have a number of orphaned nodes we would like to delete, ie Product Displays which reference no Product Variation.

I created a View with VBO which shows me these nodes, but unfortunately, it throws an error when attempting to delete since each orphan is missing certain required fields.

Is there a way to -force- VBO to delete these nodes (bypass the form validation for each delete?)

Or... is there a SQL Query you can recommend which will do the same thing (hopefully safely)?

0

Perhaps a PHP script that mimics creation of that View list and then utilizes a node_delete_multiple(). Granted, you will want to test this out very carefully before actually using a method like this.

That said, an Entity Field Query coupled with a node_delete_multiple() may be what you're looking for. Again, test very well, look at the DB after a test run, see that everything you want deleted is.

0

I only post this for any future (noob) travelers as it's probably self-evident to experienced people.

The answer is: You need to assign the View to a Page (its own alias) and execute it there. I was running it from inside the Views editor on the Admin/Overlay theme--which had worked for previous VBO updates I've done.

The error I was getting is a conflict between the Admin/Overlay theme. For some reason, when you're in the overlay, the VBO action to unpublish triggers the field validation for every field on the form on each node.

However, if you execute the View from the Page, it does NOT trigger this form/field validation code and performs the update as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.