Problem/Motivation

Hi team,

I am trying to connect using acquia connector, using my email creds.

Steps to reproduce

  1. Go to admin/config/system/acquia-connector/setup
  2. Enter Acquia Subscription email address and password on step1
  3. Selecting the subscription in step 2
  4. I see an error in step 3, and do not see the page.

The error is

Fatal error: Cannot use object of type Drupal\acquia_connector\Helper\Storage as array in docroot/modules/contrib/acquia_connector/src/Form/SetupForm.php on line 196

Version of module - 8.x-1.12
Core - 8.3.4

Proposed resolution

Do not re-use the same variable for both the Form State data array and the Storage class object during form submission.

Remaining tasks

  1. Add some tests around the Set-up form that will surface any uncaught exceptions like this in future

Comments

vaibhavjain created an issue. See original summary.

danepowell’s picture

I'm also seeing this issue with 8.x-1.12, core 8.3.5

danepowell’s picture

Title: Issue during connecting to acquia account » Error connecting to subscription
Priority: Normal » Critical

Bumping priority, since it's impossible to use the module if we can't connect it to a subscription.

irek02’s picture

I created an internal Acquia ticket to address this issue.

stevenlafl’s picture

I am seeing this as well.

arosboro’s picture

It's possible to connect if you get the error and then go to manual configuration

chop’s picture

I've just hit this and am rolling a patch. It's all here

docroot/modules/contrib/acquia_connector/src/Form/SetupForm.php

at line 187:

$storage = new Storage();

but at line 196:

empty($storage['rebuild'])

I'm sticking in a breakpoint to find the correct object property to check and rolling a patch now.

chop’s picture

Title: Error connecting to subscription » Setup Form Error: Cannot use object as array
Issue summary: View changes

updating title and refining summary

chop’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

This patch makes two changes to the \Drupal\acquia_connector\Form\SetupForm::submitForm() method:

  • Do not reuse the same variable for both the Form State storage data array, and the \Drupal\acquia_connector\Helper\Storage object.
  • Do not pass the $form_state to the \Drupal\Core\Form\FormStateInterface::getErrors() method, as this method does not accept any parameters.
chop’s picture

I've lodged a support ticket with Acquia, and pointed them to this issue and patch for review.

chop’s picture

Issue summary: View changes
adammalone’s picture

Status: Needs review » Reviewed & tested by the community

Simple patch, applies cleanly against 8.x-1.x HEAD and fixes the issue raised.

chop’s picture

Title: Setup Form Error: Cannot use object as array » Setup Form Fatal error: Cannot use object as array

We've now tested this against 3 separate Acquia Subscriptions, all with the same results.

The patch applied fixes the issue. The issue however is not found in the older 8.x-1.10 version of Acquia Connector. Currently I can reproduce on 8.x-1.12 and 8.x-1.x-dev.

  • chOP authored f702e4d on 8.x-1.x
    Issue #2892891 by chOP: Setup Form Fatal error: Cannot use object as...
irek02’s picture

Status: Reviewed & tested by the community » Fixed

The patch made it into the latest release of Acquia Connector. chOP and everyone else, thank you very much!

Status: Fixed » Closed (fixed)

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