I'm getting the following errors on my summary page (content/status-web-links)

Notice: Undefined index: emvideo_valid in theme_fbsmp_link_url() (line 642 of ../public_html/sites/all/modules/fbsmp/plugins/link.inc).
Notice: Undefined index: emaudio_valid in theme_fbsmp_link_url() (line 650 of ../public_html/sites/all/modules/fbsmp/plugins/link.inc).
Notice: Undefined index: emvideo_valid in theme_fbsmp_link_url() (line 654 of ../public_html/sites/all/modules/fbsmp/plugins/link.inc).
../public_html/sites/all/modules/fbsmp/plugins/link.inc).
Notice: Undefined index: emvideo_valid in theme_fbsmp_link_url() (line 674 of ../public_html/sites/all/modules/fbsmp/plugins/link.inc).

Does anyone know how to fix this?
Thanks
Sharon

CommentFileSizeAuthor
#5 undefined-indexes-1451030-5.patch940 bytesthirdender
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

emerham’s picture

I'm getting it to

JohnnyW’s picture

Me too

thirdender’s picture

Issue summary: View changes

We recently had this issue on our site. I was able to correct it by removing the offending Status and recreating it. It seems the statuses aren't always saved correctly, and then code tries to treat them as an image. Similar errors can be triggered by clicking the image upload button, cancelling, and then clicking the link upload button:

notice: undefined index: emvideo_valid in fbsmp_link_fbsmp_widget_form_save() (line 411 of /home/leafhead/public_html/sites/all/modules/fbsmp/plugins/link.inc).
notice: undefined index: emaudio_valid in fbsmp_link_fbsmp_widget_form_save() (line 412 of /home/leafhead/public_html/sites/all/modules/fbsmp/plugins/link.inc).
notice: undefined index: emfield_data in fbsmp_link_fbsmp_widget_form_save() (line 413 of /home/leafhead/public_html/sites/all/modules/fbsmp/plugins/link.inc).

I'll post more information as I explore deeper.

thirdender’s picture

The issue is caused when incomplete data is stored in the fbsmp database table. The data should be a serialized array of several different properties:

  • page_url
  • thumbnail
  • emvideo_valid
  • emaudio_valid
  • emfield_data
  • title
  • description

Only the properties in bold are stored for the broken statuses.

thirdender’s picture

Status: Active » Needs review
FileSize
940 bytes

This issue is caused when the user checks the "no thumbnail" checkbox when submitting a page link (URL). Lines 411-413 of link.inc copy values from the $form_state into the status data that will be saved, but only if the "no thumbnail" checkbox is unchecked.

Could someone familiar with the module clarify what the emvideo_valid, emaudio_valid, and emfield_data values should be? I dpm'ed the $form_state and they were actually undefined when I submitted the form.

For now, setting these values to NULL before saving the status if "no thumbnail" is checked solves the issue. Any statuses saved before making this change could still be missing these values in the database and could cause the error when the status is viewed. You'll need to review which statuses are causing the issue and either manually fix the database values for those statuses or delete and repost the statuses.

mathankumarc’s picture

Status: Needs review » Fixed

Committed a fix for this recently.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.