We created a custom entity embed button, and selected display plugins under the "Allowed Entity Embed Display plugins" option. However, selecting any options from this feature causes entity embedding to break.
For example, after selecting an image to embed and clicking "next", the following error is displayed:
No display options available for the selected entity. Please select another entity.
The modal screen that allows for selection of a display and view mode is never shown.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | custom_entity_embed_button_form_7.x-3.x-dev.png | 87.48 KB | sgdev |
| #4 | file_embed_creation.png | 26.86 KB | marcoscano |
| #3 | entity_embed-modal_success.png | 32.06 KB | sgdev |
| #3 | entity_embed-modal_error.png | 49.05 KB | sgdev |
Comments
Comment #2
marcoscanoHello @ron_s
Can you please provide steps to reproduce the bug?
The following steps are needed to create an embed button, which I have just tested with the latest -dev version of entity_embed without problems:
1- Go to /admin/config/content/embed and add a new embed button
2- Give it a Label, select Type: Entity, and then the entity/bundle you want to embed. (For example here: Content + Basic Page). Select here also the Display plugins, for example, let's select only "Rendered Entity" and "Label"
3- Go to the format config page (for example /admin/config/content/formats/manage/basic_html for editing the "Basic HTML" format), and drag the button you created to the Active toolbar (make sure you drag the one you have created, if you are not using a custom icon). Make sure you select the checkbox "Display embedded entities", and if you have active the filter "Limit allowed HTML...", also make sure that the embed tags are present in the field "Allowed HTML tags". This last step is not needed if you are using a recent version of the module, nowadays this gets updated when you drag the button to the Active toolbar.
4- Create some content with the ckeditor and choose an existing Basic Page on the autocomplete. You will see that in the modal window that appears after you choose the node to embed, the Display options are restricted to the ones you defined in step 2. (In this case, only "Rendered entity" and "Label".)
Are you doing anything different?
Also, please note that the "Display plugins" description on the button creation form indicates that
Note that these are the plugins which are allowed for this entity type, all of these might not be available for the selected entity.
Comment #3
sgdev commented@marcoscano, I appreciate the detailed response, but I understand how the module works. This is definitely a bug.
Here are the steps to reproduce:
Comment #4
marcoscano@ron_s, sorry for that, I certainly misunderstood your issue initially.
In any case, I might still be missing something, once the options I have with a vanilla install with the current entity_embed (dev) are not the ones you mention in steps 2 and 3:
So I could not really follow your steps to reproduce the problem. In my installation, I was able to restrict the plugin displays of a "File" entity correctly. Either I need to install something else to have a setup similar to yours or I might be missing some configuration here.. Anyways, let's wait for the maintainers of the module to see this issue, they might have some other ideas on what may be going on.
Comment #5
sgdev commentedThank you for the reply. You are using Drupal 8, and this issue is tagged to 7.x-3.x-dev.
The Entity Type description in your image is "Entity type for which this button is to enabled." This is located in the
buildConfigurationFormfunction inEntity.php.In Drupal 7, this field description is "The type of entity allowed to be embedded using the button." Also, 7.x-3.x-dev includes both entity type and bundles, while 8.x-1.x-dev does not. See attached.
Comment #6
marcoscanoSorry! my bad :(
I assumed D8 without looking into the details.. I do apologise
Comment #7
devin carlson commentedThis is a duplicate of #2634718: Display Option list not restricted to allowed configuration.