Problem/Motivation

This is similar to #2923621: If a action's pass_view is true, the action is broken. The error is:

Error: Call to a member function addMetaData() on string in /var/www/html/docroot/core/modules/views/src/Plugin/views/query/Sql.php

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

krystalcode created an issue. See original summary.

krystalcode’s picture

Created an MR with always building the query before executing. Not sure if that's the correct solution for all cases and if there's any consequence if it's built twice (in the case it's built elsewhere in some cases), works for me.

krystalcode’s picture

I have narrowed this down to the case that the batch setting is set to FALSE. When batch is set to TRUE the issue does not happen. I think that's the problem, the MR I created shouldn't be needed and might create other problems, we should find out why this happens when batch is set to FALSE - which I think is a legitimate case, you may want to process all items at once and not in batches.

phthlaap’s picture

I have same issue, the step is:
- Step 1: Check to the checkbox Select / deselect all results
- Step 2: Select an action
- Step 3: Apply to selected items
- Step 4: The form Action will be executed on all items in the view.
- Step 5: Click Execute action
=> Batch process will start then show the error message "Call to a member function addMetaData() on string...."

Applied the patch and it is working now.

phthlaap’s picture

Status: Active » Reviewed & tested by the community
graber’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Can we check if the view has been built (if (!$this->view->built))?

BTW.. I cannot reproduce this locally now, created 100 articles using devel_generate and saved them all on a standard content view with VBO field in place of the core bulk operations field, batching off, no error.

liam morland made their first commit to this issue’s fork.

liam morland’s picture

liam morland’s picture

Version: 8.x-3.x-dev » 4.4.x-dev
Status: Postponed (maintainer needs more info) » Needs review

I ran into this as part of #3555811: Call to a member function getOffset() on null in ViewsBulkOperationsActionProcessor. The existing merge request fix applies cleanly on 4.4.x and is part of fixing the issue for me.

@Dimitris Bozelos, can you change the merge request to target 4.4.x? I have rebased the change.

ron collins’s picture

@lkmorlan
This MR failed to apply against 4.3.4 and 4.4.4

liam morland’s picture

The merge request branch is on 4.4.x. The merge request needs to be switched to target 4.4.x.

ron collins’s picture

Hey VBO maintainers: what do you need to move the MR target to 4.4?

I'm currently needing to pin against an older 4.3 commit to use VBO.

liam morland’s picture

@Dimitris Bozelos (krystalcode) since you made the merge request, you are able to switch what branch it targets. Please switch it to target 4.4.x. A maintainer can also make this change.

krystalcode’s picture

I have updated the MR, thanks.

liam morland’s picture

Thanks. There is a "Rebase failed" message, but that must be a GitHub bug. The merge request is properly rebased.

erutan’s picture

Status: Needs review » Reviewed & tested by the community

I have been using this along with https://www.drupal.org/project/views_bulk_operations/issues/3555811 in 4.4.4 with no issues.

graber’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

#7 needs to be addressed before this gets a RTBC.
I'm sure there are no issues with the patch but seemed to me there are no issues without the patch as well.

liam morland’s picture

Status: Postponed (maintainer needs more info) » Needs review

I have addressed #7.

graber’s picture

Status: Needs review » Needs work

@liam, your check should always evaluate to FALSE, check line 199. If I’m not missing anything. Could you reproduce the issue?

liam morland’s picture

I have seen this before; see #10. I did not get setup to see this problem yesterday when I wrote #19. I was addressing #7 as requested in #18.

graber’s picture

Status: Needs work » Postponed (maintainer needs more info)

Sorry, I don't have enough time sometimes.. maybe if the project had at least minimal funding.

The base question here is: can we have any steps to reproduce the issue? In #7 I said I cannot reproduce and that's the main thing to address.