I made my view that uses VBO actions in version 3.2 of the module (last year).
I updated to version 3.3 of the module last year.
This week i updated from version 3.3 to 3.6 and whilst running update.php i got the following error from `views_bulk_operations_update_8034`.

Failed: InvalidArgumentException: The configuration property display.default.display_options.fields.views_bulk_operations_bulk_form.selected_actions.0.action_id.action_id doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of /app/docroot/core/lib/Drupal/Core/Config/Schema/ArrayElement.php).

See attached patch which i think addresses the problem.

Cheers.

CommentFileSizeAuthor
#9 3124833-9.patch640 bytestresti88
#2 3124833-2.patch714 bytestresti88

Comments

tresti88 created an issue. See original summary.

tresti88’s picture

StatusFileSize
new714 bytes
smustgrave’s picture

Tested the patch in #2 and the install is able to run now.

neslee canil pinto’s picture

@smustgrave, can you please attach a screenshot for your tests. Thanks.

smustgrave’s picture

----------------------- ----------- --------------- -------------------------------------------------------------
Module Update ID Type Description
----------------------- ----------- --------------- -------------------------------------------------------------
views_bulk_operations 8034 hook_update_n Convert configuration of existing views to the new schema.
----------------------- ----------- --------------- -------------------------------------------------------------

// Do you wish to run the specified pending updates?: yes.

> [notice] Update started: views_bulk_operations_update_8034
> [notice] 2 view configs converted.
> [notice] Update completed: views_bulk_operations_update_8034
[success] Finished performing updates.

neslee canil pinto’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @smustgrave, moving to RTBC

graber’s picture

Status: Reviewed & tested by the community » Active

This patch doesn't make sense, with the old config structure (see /views_bulk_operations/tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml for an example), selected actions is an associative array of strings so accessing `$plugin_id['action_id']` when $plugin_id is a string will result in a type error.

I don't know about the status of the issue but definitely not RTBC, setting this back to active, I feel that updates were already performed somehow on your instances.

If anyone wants to check on this, please try to reproduce the following way:

1. Start from a clean instance, install VBO 3.4 or lower and add a view containing the VBO field with at least one configured action.
2. Update VBO to the latest dev
3. Run database updates.

smustgrave’s picture

@Graber appears that was probably the case.

Followed the steps you mentioned and it updated without fail. Could it be possible that One developer did the updates locally, captured the changes and checked those in. Then on a dev environment when updb was ran it failed because the changes were already done.

The patch mentioned does resolve the issue for our team though.

tresti88’s picture

StatusFileSize
new640 bytes

@Graber makes sense. I did wonder why this wasn't raised before. I guess we need to check if $plugin_id is explicitly a string instead? See attached a new patch.

Just to give some background to my workflow and why i came across the error. We have Docker tooling which automatically builds our local environments from scratch, this includes pulling down a database from remote storage. This database reflects an early stage of what Drupal was in the project. When the environment builds, various commands run to import up-to date config and to run database updates etc these all bring the db inline with what the latest versions of modules expect. We also have this same process on open PRs to check and make sure builds pass before we deploy. I guess i forgot about updating my view and exporting it (which put it into the new format). To fix the issue we could update our remote db, however i believe skipping views where the $plugin_id isn't a string (assuming that's good enough) allows others to not encounter this error?

tresti88’s picture

Status: Active » Needs review
gaurav_drupal’s picture

Same issue and I tried patch #9. It worked for me. Thanks.

// Do you wish to run the specified pending updates?: yes.                                                             

>  [notice] Update started: views_bulk_operations_update_8034
>  [notice] 2 view configs converted.
>  [notice] Update completed: views_bulk_operations_update_8034
singhrt’s picture

Thanks @tresti88, saved my day #9 worked for me as well.

> [notice] Update started: views_bulk_operations_update_8034
> [notice] 4 view configs converted.
> [notice] Update completed: views_bulk_operations_update_8034

s-jack’s picture

#9. It worked for me. Thanks.

Coops_’s picture

Confirming #9 worked great, thanks!

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

I had the same issue, #9 also worked for us. This is a really small fix and while it usually is not a good idea to edit existing update hooks, in this case it seems to be the best possible solution.

+1

  • Graber committed 3846605 on 8.x-3.x authored by tresti88
    Issue #3124833 by tresti88: Error when updating
    
graber’s picture

Status: Reviewed & tested by the community » Fixed

Probably no one will experience this anymore but finally committing - this actually prevents errors when updating config that was already updated. Will do no harm and may help someone.

Thanks all!

Status: Fixed » Closed (fixed)

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