thybag / PHP-SharePoint-Lists-API

A simple PHP API to make working with SharePoint lists easy.
MIT License
184 stars 95 forks source link

Issue with updating a value in a list item #166

Closed RobLazovic closed 3 years ago

RobLazovic commented 4 years ago

Hi, I love this API and all appears to function very well indeed, with the exception of Updating a value within a list item. Based on the documentation, I am doing everything correctly. I am attempting to update a single value on a lit item and using the correct 'id' of the item to address. I only wish to update a single column value in the list item but fail to get any errors and it fails to update the value. Q: Do I need to pass over all column values for the update method to work? or, am I correct in assuming that the documentation is correct in being able to update a single field value as long as I have the reference 'id' of the list item?

Appreciate any help - I've been on this for a couple of days now, and getting frustrated at not making any progress.

my call: $callresponse = $sp->update($listname,$listitemid, array('apppassword'=>$pwd));

response: (XXXXXX = redacted data) array(1) { [0]=> array(68) { ["contenttypeid"]=> string(38) "0x0100A2865740BD816747B2440762C7CE2C47" ["employeeid"]=> string(6) "XXXXXX" ["signupdate"]=> string(19) "2019-12-18 00:00:00" ["lastlogin"]=> string(19) "2020-09-03 15:21:00" ["username"]=> string(11) "XXXXXXXX" ["accesslevel"]=> string(1) "0" ["mobilenbr"]=> string(11) "XXXXXXXX" ["apppassword"]=> string(11) "XXXXXXXXX" ["accountlocked"]=> string(1) "0" ["defaultlanguage"]=> string(1) "1" ["id"]=> string(4) "4216" ["contenttype"]=> string(4) "Item" ["modified"]=> string(19) "2020-10-28 10:03:39" ["created"]=> string(19) "2020-09-08 17:03:03" ["author"]=> string(20) "4422;#Robert Lazovic" ["editor"]=> string(20) "4422;#XXXXXXXX" ["owshiddenversion"]=> string(1) "4" ["workflowversion"]=> string(1) "1" ["_uiversion"]=> string(3) "512" ["_uiversionstring"]=> string(3) "1.0" ["attachments"]=> string(1) "0" ["moderationstatus"]=> string(1) "0" ["selecttitle"]=> string(4) "4216" ["order"]=> string(16) "421600.000000000" ["guid"]=> string(38) "{2E051D62-EA83-48EF-BC1C-3E1171C6F487}" ["fileref"]=> string(72) "4216;#sites/prodteamsite/ops/XXXXXX/Lists/Mobile App Users/4216.000" ["filedirref"]=> string(62) "4216;#sites/prodteamsite/ops/XXXXXXX/Lists/Mobile App Users" ["last_x0020_modified"]=> string(25) "4216;#2020-09-08 17:03:03" ["created_x0020date"]=> string(25) "4216;#2020-09-08 17:03:03" ["fsobjtype"]=> string(7) "4216;#0" ["sortbehavior"]=> string(7) "4216;#0" ["permmask"]=> string(18) "0x7fffffffffffffff" ["fileleafref"]=> string(15) "4216;#4216.000" ["uniqueid"]=> string(44) "4216;#{71FF313A-8625-4155-B73C-E32549250DE7}" ["progid"]=> string(6) "4216;#" ["scopeid"]=> string(44) "4216;#{349B562B-2F1E-4E70-BA4D-C9DE985D9BDC}" ["editmenutablestart"]=> string(9) "4216.000" ["_editmenutablestart2"]=> string(4) "4216" ["editmenutableend"]=> string(4) "4216" ["linkfilenamenomenu"]=> string(9) "4216.000" ["linkfilename"]=> string(9) "4216.000" ["linkfilename2"]=> string(9) "4216.000" ["serverurl"]=> string(67) "/sites/prodteamsite/ops/XXXXXXXX/Lists/Mobile App Users/4216.000" ["encodedabsurl"]=> string(102) "https://XXXXXXXXX.sharepoint.com/sites/prodteamsite/ops/XXXXXXX/Lists/Mobile%20App%20Users/4216.000" ["basename"]=> string(5) "4216_" ["metainfo"]=> string(6) "4216;#" ["_level"]=> string(1) "1" ["_iscurrentversion"]=> string(1) "1" ["itemchildcount"]=> string(7) "4216;#0" ["folderchildcount"]=> string(7) "4216;#0" ["restricted"]=> string(6) "4216;#" ["originatorid"]=> string(6) "4216;#" ["noexecute"]=> string(7) "4216;#0" ["contentversion"]=> string(7) "4216;#0" ["_complianceflags"]=> string(6) "4216;#" ["_compliancetag"]=> string(6) "4216;#" ["_compliancetagwrittentime"]=> string(6) "4216;#" ["_compliancetaguserid"]=> string(6) "4216;#" ["accesspolicy"]=> string(6) "4216;#" ["_virusstatus"]=> string(6) "4216;#" ["_virusvendorid"]=> string(6) "4216;#" ["_virusinfo"]=> string(6) "4216;#" ["smtotalsize"]=> string(9) "4216;#272" ["smlastmodifieddate"]=> string(25) "4216;#2020-10-28 10:03:39" ["smtotalfilestreamsize"]=> string(7) "4216;#0" ["smtotalfilecount"]=> string(7) "4216;#0" ["_commentflags"]=> string(6) "4216;#" ["_commentcount"]=> string(6) "4216;#" } }

RobLazovic commented 3 years ago

Found one upper-case reference name in my payload. All good now. Still does not explain why I was able to write but not update - same payload builder being used. Issue closed