SPServices.SPFilterDropdown only works when used as site owner, no longer as contributor, full permissions or other permission levels.

Jan 15, 2015 at 9:39 AM
Edited Jan 15, 2015 at 4:25 PM
Environment:

Office 365 (2013) on Dutch site collection top level site.

User A: Site owner
User B: Contributor

List 1: List with "Medicijn" column: -> lookup to Title field List 2
List 2: List containing 'Title' and 'Volgorde' columns

Script library: containing script files
SpServices: 2014-2
jquery 1.11.2

On List 1 Newform/Editform both contain a SPServices.SPFilterDropdown() functionc for the "Medicijn" Lookup column.

<script language="javascript" src="/Script/jquery.min.js" type="text/javascript"></script>
<script language="javascript" src="/Script/jquery.SPServices.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {


// Sort "Medicijn" kolom
$().SPServices.SPFilterDropdown({
    relationshipList: "Medicijnen",
    relationshipListColumn: "Title",
    relationshipListSortColumn: "Volgorde",
    columnName: "Soort medicijn Vereist veld",
    listName: $().SPServices.SPListNameFromUrl(),
    completefunc: null,
    noneText: "(Geen)",
    debug: false
});

//Set (Geen) as the default value
$("select[title='Soort medicijn Vereist veld']").prop('selectedIndex',0);

});

</script>

  • When logging in as site owner (User A) it works as expected, showing all values.
  • Wnen loggin in as reqular user (User B), the column shows no values. Only (Geen) is being shown.
  • Happens in all lists where SPServices.SPFilterDropdown() is used.
  • Required or not required does not make a difference for the situation
  • Other functions such as SPServices.SPCascadeDropdowns() still work fine.
  • This happend After an update (apparently) from Microsoft's side. ALL our customers suddenly experience the issue (About 15, each customer has own 365 environment)
Any ideas?
Coordinator
Jan 15, 2015 at 2:28 PM
Edited Jan 15, 2015 at 2:28 PM
If it works for one person and not another, it's usually a permissions issue. It could be permissions on the content or the script file.

If you remove the call to SPFilterDropdown, does User B see all of the values? In other words, take away SPServices altogether on the form and make sure that User B can access the underlying data.

M.
Jan 15, 2015 at 3:03 PM
Edited Jan 15, 2015 at 3:09 PM
Yes, i thought so too.

It's the first thing i checked. When i remove SPFilterDropdown, the user sees all the values.
The user has access to all the spservices/jquery libraries since all calls to other SPServices functions such as cascdade dropdowns work fine in the same forms, also to the same data.
The issue occurs in all forms whitch have SPFilterDropdown using it...on 15 different sites on several different tenants..overnight.
It only works for site admin...it's very odd for sure.

Barbaric workaround is to uncomment the SPFilterDropdown in all the (spservices rich) forms.
Coordinator
Jan 15, 2015 at 3:11 PM
Ok, let's see if we can figure this out. I love a mystery!

Is everyone using Dutch as their language? i.e., might User A be using English and User B be using Dutch? I've had to do some pretty odd selectors to handle different languages.

Do you see any script errors in User B's browser?

M.
Jan 15, 2015 at 4:08 PM
Hi,

I'm experiencing the same problem but with a simple query between two subsites.
Do you know something about?
Jan 15, 2015 at 4:23 PM
User B:

Post:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
            <listName>Medicijnen</listName>
            <viewName></viewName>
            <query>
                <Query>
                    <OrderBy>
                        <FieldRef Name="Volgorde"></FieldRef>
                    </OrderBy>
                    <Where></Where>
                </Query>
            </query>
            <viewFields>
                <ViewFields>
                    <FieldRef Name="Title"></FieldRef>
                </ViewFields>
            </viewFields>
            <rowLimit>0</rowLimit>
            <queryOptions>
                <QueryOptions>
                    <IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
                    <ViewAttributes Scope="RecursiveAll"></ViewAttributes>
                </QueryOptions>
            </queryOptions>
        </GetListItems>
    </soap:Body>
</soap:Envelope>
Response: 500 Internal Server Error 109ms
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring>
            <detail>
                <errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Exception from HRESULT: 0x80131904</errorstring>
                <errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x80131904</errorcode>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>
Coordinator
Jan 15, 2015 at 4:31 PM
Doing a little searching for 0x80131904, it seems to be a SQL error. That may well be a red herring, but might you be out of space?

M.
Jan 15, 2015 at 6:46 PM
It guess the Microsoft cloud servers must be running out of SQL space then :-)
Once thing is for sure, each tenant update comes with unforseen new 'features', 'bugs'. Definateley the other side of the cloud coin.
I 'hope' it a bug cause it makes no sense, at least not to me.
Coordinator
Jan 15, 2015 at 8:00 PM
Oh, yeah. Office365. You can't very well check that, can you?

Can you show me your call to SPFilterDropdown? Also, can you copy out the part of the DOM for the dropdown in question? Let me know if you need instructions for how to do that.

M.
Jan 15, 2015 at 8:42 PM
Call
// Sorteren van "Medicijn" kolom
$().SPServices.SPFilterDropdown({
    relationshipList: "Medicijnen",
    relationshipListColumn: "Title",
    relationshipListSortColumn: "Volgorde",
    columnName: "Soort medicijn Vereist veld",
    listName: $().SPServices.SPListNameFromUrl(),
    completefunc: null,
    noneText: "(Geen)",
    debug: false
});
DOM dropdown User B
        <td class="ms-formlabel" nowrap="true" valign="top" width="113px">
            <h3 class="ms-standardheader">
                <nobr>Soort medicijn<span class="ms-accentText" title="Dit is een verplicht veld."> *</span></nobr>
            </h3>
        </td>
        <td class="ms-formbody" valign="top" width="350px">
        <!-- FieldName="Soort medicijn"
             FieldInternalName="Soort_x0020_medicijn"
             FieldType="SPFieldLookup"
          -->
            <span dir="none"><select id="Soort_x0020_medicijn_ded19932-0b4f-4d71-bc3b-2d510e5f297a_$LookupField" title="Soort medicijn Vereist veld">
            <option selected="selected" value="0">(Geen)</option>
            </select><br>
            </span>
        </td>
DOM site owner
        <td class="ms-formlabel" nowrap="true" valign="top" width="113px">
            <h3 class="ms-standardheader">
                <nobr>Soort medicijn<span class="ms-accentText" title="Dit is een verplicht veld."> *</span></nobr>
            </h3>
        </td>
        <td class="ms-formbody" valign="top" width="350px">
        <!-- FieldName="Soort medicijn"
             FieldInternalName="Soort_x0020_medicijn"
             FieldType="SPFieldLookup"
          -->
            <span dir="none">
            <select id="Soort_x0020_medicijn_ded19932-0b4f-4d71-bc3b-2d510e5f297a_$LookupField" title="Soort medicijn Vereist veld">
            <option selected="selected" value="0">(Geen)</option><option value="1">Overig</option>
            <option selected="selected" value="2">Antibioticum</option>
            <option value="3">Antidepressivum</option>
            <option value="4">Antipsychoticum</option>
            <option value="5">Antistolling</option>
            <option value="6">Beenkrampen</option>
            <option value="7">Benauwdheid</option>
            <option value="8">Bèta-blokkers</option>
            <option value="9">Blaas</option>
            <option value="10">Bloedarmoede</option>
            <option value="11">Bloeddrukverlagers</option>
            <option value="12">Bloedvaten</option>
            <option value="13">Bloedverdunner</option>
            <option value="14">Botten</option>
            <option value="15">Cholesterolverlagers</option>
            <option value="16">Diarree</option>
            <option value="17">Hart</option>
            <option value="18">Hartkloppingen</option>
            <option value="19">Homeopathisch</option><option value="20">Hormoonaanvulling</option>
            <option value="21">Huiduitslag</option>
            <option value="22">Huid</option>
            <option value="23">Kalkaanvulling</option>
            <option value="24">Kalmeringsmiddel</option>
            <option value="25">Laxeermiddel</option>
            <option value="26">Luchtwegmedicatie</option>
            <option value="27">Luchtwegverwijderaars</option>
            <option value="28">Misselijkheid</option>
            <option value="29">Maagbeschermer</option>
            <option value="30">Maag-darm klachten</option>
            <option value="31">Ogen</option><option value="32">Oogboldruk</option>
            <option value="33">Onstekingsremmer</option><option value="34">Overgevoeligheid</option>
            <option value="35">Pijn op de borst</option><option value="36">Pijnstiller</option>
            <option value="37">Plas-tabletten</option><option value="38">Schildklier</option>
            <option value="39">Schimmelinfectie</option><option value="40">Slaapmiddel</option>
            <option value="41">Suikerziekte</option><option value="42">Vitamine</option>
            <option value="43">Vochtafdrijvers</option>
            </select><br>
            </span>
        </td>
Coordinator
Jan 15, 2015 at 8:55 PM
Two things, though I'm not sure they will solve the problem:
    columnName: "Soort medicijn Vereist veld", // Remove " Vereist veld". There's a fix in 2014.02 for this. You shouldn't have to use " Vereist veld" (" Required Field") in any calls anymore.
    listName: $().SPServices.SPListNameFromUrl(), // If you are in the list context, you don't need this, so remove it.
The markup for the select looks the same in both cases, so that doesn't seem to be an issue.

M.
Jan 15, 2015 at 9:11 PM
Unfortunately "Vereist veld" in the tails of required fields is still a requirement for me. not solved in 2014-02 as well (in my case), but i've learned to use it by default since the requirements form required fields almost never change.
Yes i've been sloppy on this one by not removing $().SPServices.SPListNameFromUrl(). I've removed it :-) thanks
Coordinator
Jan 15, 2015 at 9:21 PM
If the " Required Field" thing isn't solved for you in 2014.02, then I've not done my job. It would be great if we could get that fixed.

No improvement, though?

Can you check to URL I'm using for the GetListItrms call above?

Also, what happens if you remove
    relationshipListSortColumn: "Volgorde",
M.
Coordinator
Jan 15, 2015 at 9:31 PM
I think I see the problem with the " Required Field" based on your markup above. Would you be willing to try a test version of SPServices to see if it works for you?

M.
Jan 16, 2015 at 9:03 AM
  • I've tried with and without the relationshipListSortColumn: "Volgorde".
  • I've tried required and non required.
  • I've tried both listname and listid just to be sure.
If you mean : _/vti_bin/Lists.asmx?op=GetListItems, it's accessible through the browser.

I've also tried to use SPCascadeDropdowns() on the same single "Medicijn" column just to see if user B (the contributor) gets any value at all using webservices.
Functional of course it doen't make any sense but using the call below at least gives user B the first value of the relationship list, so it doens't seem to have anything to do with permission i'd say.
$().SPServices.SPCascadeDropdowns({
  relationshipList: "Medicijnen",
  relationshipListParentColumn: "Title",
  relationshipListChildColumn: "Title",
  relationshipListSortColumn: "Volgorde",
  parentColumn: "Soort medicijn Vereist veld",
  childColumn: "Soort medicijn Vereist veld",
  noneText: "(Geen)",
  simpleChild: false,           
  selectSingleOption: false,    
  matchOnId: false,         
  completefunc: null,
  debug: false
});
Jan 16, 2015 at 9:04 AM
Of course i would be willing to test. :-)
Jan 16, 2015 at 11:42 AM
Edited Jan 16, 2015 at 11:44 AM
I got a lead and i got it working.
_
(edit: I was so happy that I apperently bolded the above sentence :-)

To get it working I have to specify a additional query. (see below)
Whenever I don't specify a query, it won't work as anyone but site admin.
When I specify a query, whatever one, it works for everyone again.
So as a workaround I just query for non-empty values. (Title field in relatonship list is required) I'm sure there is a more efficient one but it'll do for now.

I'm sure it wasn't that way.
// Sorteren van "Medicijn" kolom
$().SPServices.SPFilterDropdown({
    relationshipList: "Medicijnen",
    relationshipListColumn: "Title",
    relationshipListSortColumn: "Volgorde",
    columnName: "Soort medicijn Vereist veld",
    CAMLQuery: "<Neq><FieldRef Name='Title'/><Value Type='Text'></Value></Neq>",
    completefunc: null,
    noneText: "(Geen)",
    debug: false
});
Coordinator
Jan 16, 2015 at 1:53 PM
Ah, I totally missed that you weren't supplying anything for CAMLQuery. So you're using the function just to sort the values, not filter them? That might be the underlying issue. I'll try testing for that.

I'll send you a link to a test version for the "Required Field" issue privately.

M.
Jan 16, 2015 at 4:47 PM
Sorting only indeed.

Thanks for the great help so far!
Coordinator
Jan 16, 2015 at 4:52 PM
Ok, I think that's probably at the root of the problem. At least it'll give me something else to test.

M.