Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add multivalue entity reference field to developer apps #930

Open
mxr576 opened this issue Sep 8, 2023 · 4 comments
Open

Unable to add multivalue entity reference field to developer apps #930

mxr576 opened this issue Sep 8, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mxr576
Copy link
Contributor

mxr576 commented Sep 8, 2023

Description

Probably other Apigee entity types are also affected based on the stack trace.

Apigee Info

N/A

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to /admin/config/apigee-edge/app-settings/developer-apps/fields click on Create a new field
  2. Add a new Reference -> Taxonomy term field to the entity with cardinality >= 1 (preferable choice: unlimited)
  3. Go to the developer app create form and try to save an app entity with multiple terms selected

Actual Behavior

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: Value is not a valid entity. in Drupal\Core\Entity\Plugin\DataType\EntityReference->setValue() (line 106 of core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php).

Drupal\Core\TypedData\Plugin\DataType\Map->setValue() (Line: 125)
Drupal\Core\Field\FieldItemBase->setValue() (Line: 236)
Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem->setValue() (Line: 208)
Drupal\Core\TypedData\TypedDataManager->getPropertyInstance() (Line: 82)
Drupal\Core\Field\FieldTypePluginManager->createFieldItem() (Line: 41)
Drupal\Core\Field\FieldItemList->createItem() (Line: 69)
Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue() (Line: 107)
Drupal\Core\Field\FieldItemList->setValue() (Line: 208)
Drupal\Core\TypedData\TypedDataManager->getPropertyInstance() (Line: 74)
Drupal\Core\Field\FieldTypePluginManager->createFieldItemList() (Line: 91)
Drupal\apigee_edge\Entity\AttributesAwareFieldableEdgeEntityBase->get() (Line: 395)
Drupal\apigee_edge\Entity\App->get() (Line: 333)
Drupal\apigee_edge\Entity\FieldableEdgeEntityBase->getFields() (Line: 536)
Drupal\apigee_edge\Entity\FieldableEdgeEntityBase->getIterator() (Line: 235)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues() (Line: 168)
Drupal\apigee_edge\Entity\Form\FieldableEdgeEntityForm->copyFormValuesToEntity() (Line: 301)
Drupal\Core\Entity\EntityForm->buildEntity() (Line: 123)
Drupal\apigee_edge\Entity\Form\AppForm->buildEntity() (Line: 73)
Drupal\apigee_edge\Entity\Form\FieldableEdgeEntityForm->validateForm()
call_user_func_array() (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers() (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm() (Line: 118)
Drupal\Core\Form\FormValidator->validateForm() (Line: 593)
Drupal\Core\Form\FormBuilder->processForm() (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Please notice all Drupal\apigee_edge\ references in the stack trace that relate to the Apigee entity's fieldable entity roots.

Expected Behavior

The field content is saved to Apigee as an attribute.

Screenshots

Notes

Version Info

3.0.1

@mxr576 mxr576 added the bug Something isn't working label Sep 8, 2023
@shishir-intelli
Copy link
Collaborator

@mxr576
We tried the above mentioned 3 steps however we are not able to reproduce this issue on both 3.0.0 and 3.0.1.
Is there anything we have missed?

@mxr576
Copy link
Contributor Author

mxr576 commented Sep 13, 2023

(Showcased on a screen share, please let me know if there is still an issue with reproducing it.)

@shishir-intelli
Copy link
Collaborator

Thanks @mxr576
I was able to reproduce this issue only when I check the Create referenced entities if they don't already exist checkbox in reference type setting.
Screenshot 2023-09-13 at 7 18 18 PM

Not sure though what the exact issue is.
We will check and work on it.

@shishir-intelli shishir-intelli self-assigned this Sep 26, 2023
@boobaa
Copy link
Contributor

boobaa commented Oct 12, 2023

I have a gut feeling that this is related to #948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants