I'm getting this Notice even after re-saving the field settings form and display formatter form:

Notice: Undefined index: dispaly_metadata in field_kaltura_field_formatter_view() (line 820 of sites/all/modules/contrib/kaltura/plugins/field_kaltura/field_kaltura.module)

A fix for line 820 is to change:
$settings[$key] = !empty($display['settings'][$key]) ? $display['settings'][$key] : $field['settings'][$key];
to

     $settings[$key] = !empty($display['settings'][$key]) ? $display['settings'][$key] : isset($field['settings'][$key]) ? $field['settings'][$key] : null;

Comments

xurizaemon’s picture

Status: Active » Needs review
StatusFileSize
new925 bytes

Thanks Travis. Looks like a simple typo, though ("dispaly" instead of display).

Could you please back out your current modification and try this patch instead?

I would expect that with the fix posted above, you will find the field settings aren't applied correctly. This may behave a bit better.

travismccauley’s picture

I had assumed that the typo wasn't the problem since I don't see the 'display_metadata' anywhere else in the codebase and it also wasn't in either of the settings arrays. I'll check again though

xurizaemon’s picture

Status: Needs review » Postponed (maintainer needs more info)

Travis - did you need both fixes, or just one of the above?

travismccauley’s picture

Hi - I still need both patches, yes.

I noticed that if I check the display_metadata checkbox, then I don't get the php notices at all (without needing either patch). I've chosen thumbnail only option for the display formatter, so I don't see the metadata even with the checkbox checked. I'm not sure what behavior that checkbox adds but if you check it, it makes the php notices go away.

klausi’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.41 KB

Why is this needed?

foreach ($display['settings'] as $key => $val) {
  $settings[$key] = !empty($display['settings'][$key]) ? $display['settings'][$key] : $field['settings'][$key];
}

If display_metadata is set to 0 then the empty check will evaluate to true and we try to load the setting from the field, which seems wrong to me. I think we can remove this loop altogether.

travismccauley’s picture

Hi Klausi, Thanks for the patch. Sorry for the slooooow reply. I've been using my own patch, This seems to solve the problem for me. I'll keep an eye out too and report back any issues.

Thanks again!!
-Travis

Anonymous’s picture

Why has this patched not been rolled into the latest Dev version? You released an updated version of the module which this patch should have been in over 14 months ago. Your latest dev from September doesn't have it. Please correct this.

khal3dn’s picture

I have similar issues as below. How to solve it? Any idea? I appreciate your cooperation and understanding in this regard.

Notice: Undefined index: dispaly_metadata in field_kaltura_field_formatter_view() (line 820 of /home3/emslpnet/public_html/deaftube/sites/all/modules/modules/kaltura/plugins/field_kaltura/field_kaltura.module).
Notice: Undefined index: dispaly_metadata in field_kaltura_field_formatter_view() (line 820 of /home3/emslpnet/public_html/deaftube/sites/all/modules/modules/kaltura/plugins/field_kaltura/field_kaltura.module).

pumpkinkid’s picture

Issue summary: View changes

The patch on #5 resolved these issues for me as well. Please correct this.