When using the content browser on entity reference fields with a limited selection of allowed content types (Reference Type / Content Types), the entity browser does show all system wide available entity types instead of the limited types only. As this allows a user to add content references to nodes that he should not be able to, I consider this a bug.
Will happily provide further information, if required.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | filter_by_content_type-2851687-11.patch | 5.07 KB | oriol_e9g |
Comments
Comment #2
mylies commentedComment #3
mylies commentedComment #4
samuel.mortensonComment #5
samuel.mortensonHere's a patch that, combined with the latest release of Entity Browser and the latest patch from [#32865928], provides a contextual filter that restricts content in the Content Browser by Content Type. You should be able to patch Entity Browser, patch Content Browser with this patch, then update databases to see the change.
Please test this and let me know what you think! I won't add it until Entity Browser commits/releases issue mentioned above, but early feedback would be much appreciated. Thanks!
Comment #6
samuel.mortensonRe-roll.
Comment #7
greedesign commentedThe patch failed for me however I was able to get it to work with this change to the patch file. After the patch failed my content_browser.install.rej file pointed to the
use Drupal\Core\Config\ExtensionInstallStorage;line and when comparing it to to my file, my line wasuse \Drupal\Core\Config\ExtensionInstallStorage;. Not sure if this will be the case for others.Sorry for not committing a new patch re-roll but I have never done that before and tight for time at work.
Comment #8
bappa.sarkar commentedDoes not respect content type limitations - When we use entity browser with inline entity form. https://www.drupal.org/project/content_browser/issues/2929301
Comment #9
bappa.sarkar commentedThe 2851687-6.patch not applicable in 8.x-1.0-alpha4 version due to a slash(\) added in the Drupal namespace in the install file.
Comment #10
ankit agrawal commentedI am getting the following error when trying to run update script for newly added update hook:
Comment #11
oriol_e9gRerolled patch.
Comment #12
samuel.mortensonDoes anyone have time to review and test the patch, then move the issue to RTBC?
Comment #13
antiorario commentedIt seems to be working well.
Comment #15
samuel.mortensonThanks @antiorario! I addressed #10 and #7 on commit as well.
This will be in the next Content Browser release, but I have to wait until Entity Browser has a new release that includes the Views plugin.