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

Channel bundles -> Content type option doesn't appear #29

Open
rupertj opened this issue Nov 15, 2024 · 7 comments
Open

Channel bundles -> Content type option doesn't appear #29

rupertj opened this issue Nov 15, 2024 · 7 comments
Assignees

Comments

@rupertj
Copy link
Member

rupertj commented Nov 15, 2024

Create a new Finder entity.

Choose the channel bundle entity type.
Channel bundle content type does not appear.

If you choose the entry bundle entity type, then change the channel bundle entity type to something else, then back to Content, the Channel bundle content field does appear.

@joachim-n
Copy link

Are there any JS errors in the console? It was working for me, though either I happened to do it in the right order, or I've forgotten to commit a file!

@rupertj
Copy link
Member Author

rupertj commented Nov 15, 2024

Yes there are!

ResponseText: The website encountered an unexpected error. Try again later.Drupal\Component\Plugin\Exception\PluginNotFoundException: The "container" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 142 of core/lib/Drupal/Core/Entity/EntityTypeManager.php). Drupal\finders\Element\EntityBundles::processEntityBundles()
call_user_func_array() (Line: 1006)

@joachim-n
Copy link

The "container" entity type does not exist

That sounds like the top-level form element in the custom form element plugin is somehow getting picked up as the value for the entity type.

@joachim-n
Copy link

Can you debug around line 100 of EntityBundles? $selected_entity_type_id is getting set to the wrong thing -- almost certainly because I frankencoded this class from Action Link module....

@rupertj
Copy link
Member Author

rupertj commented Nov 15, 2024

$selected_entity_type_id is getting set to 'container' on line 100, which is the case where it's not including 'container' in the element parents.

The chosen entity_type_is is in the formState's values at: $form_state->values["entries"]["container"]["entity_type_id"];

@joachim-n
Copy link

Thanks!

I know what's gone wrong -- in Action Link I added the method that gets the value for a form element, in an attempt to remove the 'container' nesting from the values -- which doesn't quite work. Without that, there's never a case when it's not nested like that. You can remove that clause completely.

@rupertj
Copy link
Member Author

rupertj commented Nov 15, 2024

Ta. I had to do a bit more than that to handle some confusion between the empty string and null to make it work. It's in PR #31 into your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants