Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a check for the bundle on the referencing entity for the file preprocess that makes sure the bundle on the fieldable_panels_pane is media pane. However some entities have a different key name to 'bundle' (eg, for a node it is 'type' not 'bundle').
I propose fixing this using the following code change:
# On branch 7.x-1.x
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: media_pane.module
#
no changes added to commit (use "git add" and/or "git commit -a")
-sh-4.1$ git diff
diff --git a/media_pane.module b/media_pane.module
index edca125..bf673e3 100644
--- a/media_pane.module
+++ b/media_pane.module
@@ -57,7 +57,7 @@ function media_pane_get_view_mode_options() {
function media_pane_preprocess_file_entity(&$variables) {
$entity = $variables['referencing_entity'];
- if ($entity->bundle != 'media_pane') {
+ if (!isset($entity->bundle) || $entity->bundle != 'media_pane') {
return;
}
Comment | File | Size | Author |
---|---|---|---|
#11 | bundle_check_in_file-1983322-11.patch | 559 bytes | yanniboi |
#5 | media_pane-render-bug-1983322-4.patch | 603 bytes | jamesrutherford |
Comments
Comment #1
yanniboi CreditAttribution: yanniboi commentedComment #2
jamesrutherford CreditAttribution: jamesrutherford commentedUpdated the patch to check and make sure referencing_entity is actually set, as it will not be on a direct file view ex: http://mysite.org/file/1
Comment #4
jamesrutherford CreditAttribution: jamesrutherford commentedResubmitting patch.
Comment #5
jamesrutherford CreditAttribution: jamesrutherford commentedOk followed directions this time. Patch should be accepted.
Comment #6
jamesrutherford CreditAttribution: jamesrutherford commentedMoving to needs review.
Comment #7
wrd CreditAttribution: wrd commentedPatch seems to work for me.
Comment #8
scottrigby@jamesrutherford i literally just wrote the same check, before looking for an issue to add the patch. This is good :+1:
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commented+1, affects media that's rendered via Media WYSIWYG as well. Patch makes this module play nice.
Comment #10
Christopher Riley CreditAttribution: Christopher Riley commentedPatch #5 took care of a WSOD issue I was running into. Please commit this patch.
Comment #11
yanniboi CreditAttribution: yanniboi at FreelyGive commentedSorry guys, I committed a fix to this to the dev branch in 2013, but there was no 7.x-1.x-dev release.
I have re-rolled the patch because it didn't apply to dev, but will now.
Comment #13
yanniboi CreditAttribution: yanniboi at FreelyGive commentedFixed in release 7.x-1.1.