ERROR in Query!

Topics: Need help
Jun 7, 2010 at 5:00 PM
I followed all of the steps in the Documentation section, and the web part throws the following error: ERROR in Query!TestMicrosoft.SharePoint.SPException: One or more field types are not installed properly. Go to the list settings page to delete these fields. ---> System.Runtime.InteropServices.COMException (0x81020014): One or more field types are not installed properly. Go to the list settings page to delete these fields. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) --- End of inner exception stack trace --- at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at Microsoft.SharePoint.SPListItemCollection.get_Item(Int32 iIndex) at KhaledWebparts.MediaPlayerWebpart.RenderWebPart(HtmlTextWriter output) Any help would be appreciated
Jun 7, 2010 at 5:12 PM
Edited Jun 7, 2010 at 5:52 PM

Here is some additional information:

 

  • My custom list is named "MediaPlayerWebPartHTML"
  • I created a "Value" field in this custom list
  • I created a new item in the list.  The Title is "Test" and the Value is as follows:

<h3>{{$Title$}}</h3> 
{{$Desc$}} 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{{$Width$=300}}" height="{{$Height$=200}}"> 
<param name="movie" value=\\localhost\M2U01113.mpg /> 
<param name="flashvars" value="file={{$File$}}&autostart={{$Autoplay$}}" /> 
<param name="allowfullscreen" value="true" /> 
<!--[if !IE]>--> 
<object type="application/x-shockwave-flash" data=\\localhost\M2U01113.mpg width="{{$Width$=300}}" height="{{$Height$=200}}"> 
<param name="flashvars" value="file={{$File$}}&autostart={{$Autoplay$}}" /> 
<!--<![endif]--> 
<a href="http://www.adobe.com/go/getflashplayer"> 
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> 
</a> 
<!--[if !IE]>--> 
</object> 
<!--<![endif]--> 
</object> 
  • Once created, I added the webpart to my site collection and then added it to my web part page.  I exported it and modified it as specified.  For the record, here are the contents of my updated webpart file:
<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="KhaledWebparts.MediaPlayerWebpart, MediaPlayerWebpart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7e91954d53dba15b" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name="Valuetype" type="string">Text</property>
        <property name="Listurl" type="string">http://portal.com/site/Lists/MediaPlayerWebPartHTML</property>
        <property name="Textbelow" type="string" />
        <property name="ExportMode" type="exportmode">All</property>
        <property name="AllowClose" type="bool">True</property>
        <property name="Pwidth" type="string" />
        <property name="Listnamefieldval" type="string">Test</property>
        <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
        <property name="Textabove" type="string" />
        <property name="Mediaurl" type="string" />
        <property name="TitleUrl" type="string" />
        <property name="AllowZoneChange" type="bool">True</property>
        <property name="TitleIconImageUrl" type="string" />
        <property name="Listnamevalfield" type="string" />
        <property name="Hidden" type="bool">False</property>
        <property name="Direction" type="direction">NotSet</property>
        <property name="HelpMode" type="helpmode">Modeless</property>
        <property name="Query" type="string">&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='Title' /&gt;&lt;Value Type='Text'&gt;Value&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;</property>
        <property name="ChromeType" type="chrometype">Default</property>
        <property name="CatalogIconImageUrl" type="string" />
        <property name="Videourl" type="string" />
        <property name="Autoplay" type="bool">False</property>
        <property name="Height" type="string" />
        <property name="Description" type="string" />
        <property name="HelpUrl" type="string" />
        <property name="Ptitle" type="string" />
        <property name="Listnamefield" type="string" />
        <property name="AllowMinimize" type="bool">True</property>
        <property name="AllowEdit" type="bool">True</property>
        <property name="Desc" type="string" />
        <property name="Pheight" type="string" />
        <property name="Title" type="string">MediaPlayerWebpart</property>
        <property name="Width" type="string" />
        <property name="ChromeState" type="chromestate">Normal</property>
        <property name="AllowHide" type="bool">True</property>
        <property name="AllowConnect" type="bool">True</property>
      </properties>
    </data>
  </webPart>
</webParts>
  •  Once updated, I imported the webpart file back into SharePoint and overwrote the original webpart
Coordinator
Jun 8, 2010 at 7:56 PM
Edited Jun 8, 2010 at 8:16 PM

Hi,

Thanks for contacting me. Could you please provide a screenshot of both the error and the list settings page (showing all the fields) of your list, so I can have a look at them as well.

You can do this by taking a screenshot using the Print Scr button on your keyboard then opening any standard painting program like Microsoft Paint or Photoshop and pasting the screenshot in there, then saving the file and uploading it to http://imageshack.us/, and sending me the link.

I look forward to helping you with your problem.

Thank you,

Khaled

Jun 10, 2010 at 4:12 PM

Here are the screenshots:

Error - http://www.flickr.com/photos/sephiroth0327/4688385468/sizes/l/

List Settings - http://www.flickr.com/photos/sephiroth0327/4688385492/sizes/l/

List Item - http://www.flickr.com/photos/sephiroth0327/4687752561/sizes/l/

Coordinator
Jun 10, 2010 at 5:36 PM

Hi,

Thanks for posting the screenshots. It looks like you have forgotten to carry out Step 42 in the documentation. Which would be to change:

<property name="Listnamevalfield" type="string" /> to <property name="Listnamevalfield" type="string">Test</property> ('Test') In your case.

http://mpwp.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=99363

By the way, looking at the following lines:

<param name="movie" value=\\localhost\M2U01113.mpg /> and <object type="application/x-shockwave-flash" data=\\localhost\M2U01113.mpg width="{{$Width$=300}}" height="{{$Height$=200}}">

\\localhost\M2U01113.mpg should'nt be there, mpg shows that this file is a movie file, but what should be there is a URL to an FLV player, such one you can obtain here: http://www.longtailvideo.com/players/jw-flv-player/

The code you are using above, which I put in the Documentation as a sample, is only for a player that works using Flash, if you have code for a Silverlight player, Java player, Windows Media Player, etc, whatever, you want to use then put that code in the list and put the variables in there accordingly (i.e. $Title$, $Desc$, $Width$=300, $Height$=200, $File$, $Autoplay$). You can also add multiple rows in the list and make separate webpart files having different Listnamevalfield values (as shown above, yours at the moment is 'Test', you could have another one called 'Silverlight' or 'WindowsMedia', etc). Look at the screenshot in the following link to help you understand what I mean: http://mpwp.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=99363

Let me know if you still experience any problems.

Khaled

Coordinator
Jun 15, 2010 at 1:30 AM

Hi,

Did that work then? Do you still have problems?

Please let me know.

Khaled