If the entity uses paragraphs the "add paragraph" field selector is displayed on the configure form, along with an error (see below).

If the paragraphs field is required, submitting the configure form will fail with "field is required". This prevents editing any field on the entity.

This possibly applies to any referenced entity handled via the entity_reference_revisions module and widget. Possibly inline entity form too?

Notice: Only variable references should be returned by reference in Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement() (line 361 of modules/contrib/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php).
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 357)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 357)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 313)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->getSelectorForm('node', 'page', Array) (Line: 282)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->getBundleForm('node', 'page', 'Generic page', Array, Object) (Line: 112)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->buildConfigurationForm(Array, Object) (Line: 124)
Drupal\views_bulk_operations\Form\ConfigureAction->buildForm(Array, Object, 'content', 'page_1')
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder->retrieveForm('views_bulk_operations_configure_action', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('views_bulk_operations_configure_action', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

John Pitcairn created an issue. See original summary.

brooke_heaton’s picture

I'm seeing this same issue.

Notice: Only variable references should be returned by reference in Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement() (line 365 of modules/contrib/views_bulk_edit/src/Plugin/Action/ModifyEntityValues.php).
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 361)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 361)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->findFormElement(Array) (Line: 317)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->getSelectorForm('node', 'event', Array) (Line: 284)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->getBundleForm('node', 'event', 'Meeting', Array, Object) (Line: 114)
Drupal\views_bulk_edit\Plugin\Action\ModifyEntityValues->buildConfigurationForm(Array, Object) (Line: 124)
Drupal\views_bulk_operations\Form\ConfigureAction->buildForm(Array, Object, 'content', 'page_1')
call_user_func_array(Array, Array) (Line: 514)
Drupal\Core\Form\FormBuilder->retrieveForm('views_bulk_operations_configure_action', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('views_bulk_operations_configure_action', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 99)
Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
brtamas’s picture

Patch attached.

benjy’s picture

Status: Active » Needs review
+++ b/src/Plugin/Action/ModifyEntityValues.php
@@ -383,7 +383,9 @@ class ModifyEntityValues extends ViewsBulkOperationsActionBase implements Contai
-    return NULL;
+
+    $null = NULL;
+    return $null;

We could delete the return entirely? Would that resolve the issue?

graber’s picture

StatusFileSize
new849 bytes

Can you check if this solves the problem as well?

Status: Needs review » Needs work

The last submitted patch, 5: 2934226-5-better-reference-handling.patch, failed testing. View results

graber’s picture

Status: Needs work » Needs review
StatusFileSize
new907 bytes

Right.

Status: Needs review » Needs work

The last submitted patch, 7: 2934226-7-better-reference-handling.patch, failed testing. View results

graber’s picture

StatusFileSize
new865 bytes

Sunday coding..

graber’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB
jibran’s picture

We should add tests here.

Chris Charlton’s picture

Patch helped.

Chris Charlton’s picture

Just want to reiterate, patch #10 helped get this unstuck for me.

trevorbradley’s picture

Status: Needs review » Needs work

This doesn't seem to be quite right. I have some paragraph form structures where #title and #type never seem to be at the same level. Abridged, my no-default multiple possible paragraph in a single paragraph field looks like:

'field_bad_paragraph_field' => [
  '#type' => 'container',
  'widget' => [
    '#title' => 'Correct Title',
    'add_more' => [
      '#type' => 'container',
      'operations' => [
        '#type' => 'paragraph_operations',
      ],
      'add_more_X' => [
        '#type' => 'submit',
      ],
      'add_more_Y' => [
        '#type' => 'submit',
      ],
      'add_more_Z' => [
        '#type' => 'submit',
      ],
    ],
  ],
]

#title and #type never seem to be at the same recursion level at the same time.

I'm going to try a different approach here, see if I can pass good Titles down through the recursive function without breaking VBO/VBE.

trevorbradley’s picture

Status: Needs work » Needs review
StatusFileSize
new2.31 KB

OK, here's my attempt. While findFormElements drills down, it now keeps track of $title from previous iterations just in case this doesn't have them.

Appears to work better than what was there, but definitely needs review.

bfodeke’s picture

#15 works for me. This happens to address two separate issues.

samuel.mortenson’s picture

StatusFileSize
new12.7 KB
new10.49 KB

The patch in #15 didn't work for me when using the "Paragraphs Classic" widget.

samuel.mortenson’s picture

StatusFileSize
new2.51 KB
new661 bytes

Facepalm, didn't mean to include my .idea folder.

drup16’s picture

Status: Needs review » Reviewed & tested by the community

Patch from #18 works.

graber’s picture

Status: Reviewed & tested by the community » Fixed

Hope this solves the issue for everyone, thanks!

joelsteidl’s picture

Curious if this actually allows creating Paragraphs on a node. Happy to open a new issue, but wanted to make sure it was different.

So far I can't get it working. Using 8.x-2.5 Views Bulk Operations & 8.x-2.4 Views Bulk Edit (tried dev as well)

I've tried Classic and Experimental widgets for the Paragraph.

I can add the Paragraph without error, but when I go edit the node, nothing is there for the Paragraph field.

Thank you!

trevorbradley’s picture

@joelsteidl - as this ticket is fixed, passed and now part of the latest release, I'd strongly suggest making a new ticket.

joelsteidl’s picture

@TrevorBradley

Thanks for the quick reply. Any input on versions of VBO/VBE that I should be using. I don't want to flag this as a new issue if I'm simply using the wrong versions.

Also, was this issue's original intent to make Paragraphs work with VBE or solve an error that was happening. Sorry, the issue is not super clear.

johnpitcairn’s picture

It was to solve an error when VBO processing the parent entity.

trevorbradley’s picture

VBO and VBE both were recently updated (about 4 days ago). Try again with both those versions and verify your behaviour.

I'm not saying your issue is invalid! It's just that even if it were an issue with this ticket, it's going to have to be fixed in a new ticket. The code is committed and can only be repaired, not recalled...

Status: Fixed » Closed (fixed)

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

osopolar’s picture

@joelsteidl: Did you find the problem and got it work? Adding paragraphs with VBE is working for me only if a default paragraph type is defined for the form widget.