Problem/Motivation

When trying to add aditional project I get errors:

  • additionalProjects.0.shortname: This value should not be blank.
  • additionalProjects.0.type: This value should not be blank.
  • additionalProjects.0.type: This value should not be null.
  • additionalProjects.0.version: This value should not be blank.

I tried with select2boxes module and entity_autocomplete_hierarchy module. I also tried with some other combinations, but I get the same errors all the time.

Steps to reproduce

  • Add select2boxes module
  • Add entity_autocomplete_hierarchy as additional module
  • Click "Launch Sandbox

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork simplytest-3236812

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

matsbla created an issue. See original summary.

mglaman’s picture

Assigned: Unassigned » mglaman
Priority: Normal » Major
Issue summary: View changes

Thanks for the issue report! I was able to reproduce. For some reason when the additional project is selected the state isn't update.

I checked the React context and the value wasn't bubbled up

{
  "value": {
    "selectedProject": {
      "title": "Select2 Boxes",
      "shortname": "select2boxes",
      "type": "Module",
      "sandbox": 0
    },
    "selectedVersion": "8.x-1.0-alpha8",
    "patches": [
      ""
    ],
    "installProfile": "standard",
    "drupalVersion": "9.2.6",
    "manualInstall": false,
    "canLaunch": "8.x-1.0-alpha8",
    "additionalProjects": [
      {
        "version": "",
        "patches": "[]",
        "title": "",
        "shortname": ""
      }
    ]
  }
}

So we also need to do some error handling and validation before submitting the form.

mglaman’s picture

Note: Can we give credit to TR for additional in depth bug report

mglaman’s picture

Title: additionalProjects.0.shortname: This value should not be blank. » AdditionalProjects component is not updating context value when projects added.

Updating title to reflect bigger bug. You cannot change the branch value or even clear the autocomplete value.

mglaman’s picture

I found the problem. I am not sure why this started happening, but it was due to an infinite loop on a side effect and re-render. I was passing an anonymous function a React side effect inside of the AdditionalProjects component for the ProjectSelector. This caused the app to basically crash. This MR should fix it up.

mglaman’s picture

Status: Active » Needs review

MR opened. Adds fixes and state management improvements.

nerdstein’s picture

Status: Needs review » Fixed

This has been merged, thanks!

Status: Fixed » Closed (fixed)

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