Commit 13214aee authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3321029 by yas, Xiaohua Guan: Fix an Internal Server Error: "TypeError:...

Issue #3321029 by yas, Xiaohua Guan: Fix an Internal Server Error: "TypeError: Drupal\cloud\Service\CloudService::loadAllEntities()" when displaying an OpenStack create form
parent 61262787
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ class OpenStackFloatingIpCreateForm extends ElasticIpCreateForm {
   *   Array of form object.
   */
  public function buildForm(array $form, FormStateInterface $form_state, $cloud_context = ''): array {

    // Switch OpenStack EC2 or REST service based on $cloud_context.
    $this->ec2Service = $this->openStackServiceFactory->get($cloud_context);

+2 −0
Original line number Diff line number Diff line
@@ -175,8 +175,10 @@ class OpenStackFloatingIpEditForm extends ElasticIpEditForm {
   *   Array of form object.
   */
  public function buildForm(array $form, FormStateInterface $form_state, $cloud_context = ''): array {

    // Switch OpenStack EC2 or REST service based on $cloud_context.
    $this->ec2Service = $this->openStackServiceFactory->get($cloud_context);

    $form = parent::buildForm($form, $form_state, $cloud_context);
    if ($this->ec2Service instanceof OpenStackRestService) {
      unset($form['assign']['domain']);
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ class OpenStackImageCreateForm extends ImageCreateForm {

    // Switch OpenStack EC2 or REST service based on $cloud_context.
    $this->ec2Service = $this->openStackServiceFactory->get($cloud_context);

    $form = parent::buildForm($form, $form_state, $cloud_context);

    // Custom buildForm logic for OpenStack REST API.
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ class OpenStackImageEditForm extends ImageEditForm {

    // Switch OpenStack EC2 or Rest service based on $cloud_context.
    $this->ec2Service = $this->openStackServiceFactory->get($cloud_context);

    /** @var \Drupal\openstack\Entity\OpenStackImage $entity */
    $form = parent::buildForm($form, $form_state, $cloud_context);

+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ class OpenStackInstanceEditForm extends InstanceEditForm {
   *   Array of form object.
   */
  public function buildForm(array $form, FormStateInterface $form_state, $cloud_context = ''): array {

    // Switch OpenStack EC2 or Rest service based on $cloud_context.
    $this->ec2Service = $this->openStackServiceFactory->get($cloud_context);

Loading